In Protractor, Error “session not created: This version of ChromeDriver only supports Chrome version 84” - protractor

I have this problem for a few day and I have noticed that chromedriver version has been upgraded automaticlly to the 86. So I am guessing I need to downgrade it to 84. But I am not sure. May be I should upgrade something but I do not know what. My webdriver-manager vesrion is "webdriver-manager": "^12.1.7",
Any hints, please?

Try the below command to resolve the webdriver update issue
node node_modules/protractor/bin/webdriver-manager update --versions.chrome=<desired chrome version> --standalone --gecko=false --ignore_ssl

Try this if you want to run on chrome browser.
In protractor sometime gets Error: ”Session not created ” because of not supported/incompatibility driver version for current browser version.
I have tried below steps:
Step 1: Delete selenium folder inside webdriver-manager .
All browser driver should be presented in this folder.
Path: ..\node_modules\protractor\node_modules\webdriver-manager\selenium
Step 2: node node_modules/protractor/bin/webdriver-manager update - This will download all browser driver versions inside selenium folder.
Or else you can update webdriver-manager with specific version you want.
node node_modules/protractor/bin/webdriver-manager update --versions.chrome=XX.X.XXXX.X

Related

Flutter on a MacBook M1: Unable to get flutterfire_cli to work while setting up a Web App

I'm VERY new to the Mac OS (I'm running macOS Monterey v12.4) on an M1 Macbook Pro.
I have Flutter installed and have built a few sandbox apps with this framework.
I'm trying to build a web application with Flutter and Cloud Firestore and thought it best to use the flutterfire_cli to do some of the configurations but I'm stuck trying to run a specific setup command.
The command that I'm trying to run is "dart pub global activate flutterfire_cli" from a terminal. The output that I get is the following when I run this (the error is at the bottom):
ansi_styles 0.3.2+1s...
args 2.3.1
async 2.9.0
ci 0.1.0
cli_util 0.3.5
collection 1.16.0
dart_console 1.0.0
deep_pick 0.10.0
ffi 1.2.1 (2.0.0 available)
file 6.1.2
flutterfire_cli 0.2.2+2
http 0.13.4
http_parser 4.0.1
interact 2.1.1
json_annotation 4.5.0
matcher 0.12.11
meta 1.8.0
path 1.8.2
petitparser 5.0.0
platform 3.1.0
process 4.2.4
pub_semver 2.1.1
pub_updater 0.2.2
pubspec 2.2.0
quiver 3.1.0
source_span 1.9.0
stack_trace 1.10.0
string_scanner 1.1.1
term_glyph 1.2.0
tint 2.0.0
typed_data 1.3.1
uri 1.0.0
win32 2.6.1 (2.7.0 available)
xml 5.4.1 (6.1.0 available)
yaml 3.1.1
Could not find a file named "pubspec.yaml" in "/Users/myusername/.pub-cache/hosted/pub.dartlang.org/flutterfire_cli-0.2.2+2".
When I try to run the next command according to the documentation here: https://firebase.google.com/docs/flutter/setup?platform=web
That command is "flutterfire configure" from within Android studio
I get the following error: "zsh: command not found: flutterfire"
I'm running node version "v16.15.1" and nvm version "0.39.1" with npm version "8.12.1"
Has anyone run into this?
Thanks!
In your termianl run:
export PATH="$PATH":"$HOME/.pub-cache/bin"
Then try to use flutterfire command in your project directory.
Thanks for that response shuster.
I'm afraid that my environment needed abit more help as there were errors when running several commands. I'll outline the steps I used below to finally get this working.
Steps to resolve the issue
Delete Node and NPM (aka - fresh start)
This post here outlined a straightforward way to do this: https://www.positronx.io/how-to-uninstall-node-js-and-npm-from-macos/
Reinstall node WITHOUT using the 'sudo' command using NVM
Verify that all versions are in place and working for NVM, NODE and NPM - all good
Was still getting issues with the command from Dart to activate the flutterfire_cli "dart pub global activate flutterfire_cli"
I didn't capture the exact error, but there was a complaint about a PUBSPEC.YAML missing
I suspected that something was wrong with my Dart installation or cache, so I decided to try clearing the cache
Repairing the cache using this command "dart pub cache repair" produced a "permissions denied" error on the .pub-cache folder
Cleaning the DART cache using this command "dart pub cache clean" produced the same "permissions denied" error on the same folder
So, I went in and deleted everything in that .pub-cache folder manually
I then went back to the terminal and ran the command "dart pub global activate flutterfire_cli" to try and get Dart into a better place
This worked but I got an error message (basically) stating that the path was wrong for a global command and I needed to run "export PATH="$PATH":"$HOME/.pub-cache/bin"
If I ran that PATH command from the terminal, then the Flutterfire CLI would work for that session only but not work in my IDE (Android Studio) unless I ran that same command again inside the IDE
At this point I knew I was very close and needed to figure out how to get this Mac to keep that setting all the time
After some digging into what this "zsh" thing was, I found a post that explained it very well and was able to make the change permanent https://wpbeaches.com/how-to-add-to-the-shell-path-in-macos-using-terminal/
 
Hope this helps someone - happy coding!

Not able to launch chrome in protractor

While launching conf.js file in protractor its giving below error :
ERROR [OsProcess.checkForError] - org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_87.0.4280.88" (in directory "."): error=86, Bad CPU type in executable)
https://github.com/angular/webdriver-manager/issues/476
Fix will be available soon this weekend. but you will get a workaround by doing this.
As I badly needed to get unblocked - here is a hacky workaround for anyone in similar situation (only for x86_64 macOS). In node_modules/webdriver-manager/built/lib/files/file_manager.js update fileUrl.url around 166:
add below line
fileUrl.url = fileUrl.url.replace(/_m1/, '')
Was facing the similar issue in MacOs Catalina.
This is how it got resolved for me with below versions :
Option 1 :
Download these :
https://chromedriver.storage.googleapis.com/71.0.3578.33/chromedriver_mac64.zip
https://selenium-release.storage.googleapis.com/3.14/selenium-server-standalone-3.14.0.jar
And made the Selenium server UP with this :
java -Dwebdriver.chrome.driver=./chromedriver_71.0.3578.33 -jar ./selenium-server-standalone-3.141.59.jar -port 4444
Option 2 :
Protractor :
Use the below versions :
webdriver-manager update --versions.chrome=71.0.3578.33
webdriver-manager --versions.chrome=71.0.3578.33 start
Got an Error
"Timed out waiting for driver server to start." After running
webdriver-manager update
Resolved it by downgrading to the previous version of webdriver that was working for you.
Steps:
navigate to node_modules/protractor/node_modules/webdriver-manager/selenium/
check if you can see the last chromedriver that you were using before the update
for my case this is chromedriver_86.0.4240.22
since I still have my previous chromedriver, I just Deleted
chromedriver_87.0.4280.88
chromedriver_87.0.4280.88.zip
in node_modules/protractor/node_modules/webdriver-manager/selenium/update-config.json
I changed all instances of chromedriver_87.0.4280.88 and replaced with chromedriver_86.0.4240.22
Run your tests.
Incase you dont know what was the last version that worked for you, you can try
webdriver-manager update --versions.chrome=86.0.4240.22
or look for a version here
This is what worked for me:
Update the protractor version to current stable version: "protractor": "^7.0.0", npm install was the way to go for me, yours will be similar
Update the webdriver: webdriver-manager update with or without sudo is the right command as stated in other answers
Run the webdriver manager with the current chrome version, this is the command that I use for application: webdriver-manager start --versions.chrome=88.0.4324.96 as my chrome is currently at that version, replace it with your chrome's version (87.0.4280.88 as per the question)

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85

Currently i am working protractor UI testing. My testcase is working properly so far, but suddenly it shows a webdriver problem. My current chrome version is 84. But the selenium driver is expecting version 85. Version 85 is still not released.
[14:56:46] E/launcher - session not created: This version of ChromeDriver only supports Chrome version 85
(Driver info: chromedriver=85.0.4183.38 (9047dbc2c693f044042bbec5c91401c708c7c26a-refs/branch-heads/4183#{#779}),platform=Windows NT 10.0.17134 x86_64)
[14:56:46] E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 85
(Driver info: chromedriver=85.0.4183.38 (9047dbc2c693f044042bbec5c91401c708c7c26a-refs/branch-heads/4183#{#779}),platform=Windows NT 10.0.17134 x86_64)
Either use webdriver-manager to specify your chromedriver version or use --webdriverUpdate=false if running e2e tests
(see: https://github.com/angular/protractor/issues/5460)
There seems to be an issue where webdriver-manager is installing ChromeDriver 85 even though Chrome 84 is the current stable release. Multiple people have reported this issue.
I've posted a workaround in issue 376
Overall, you temporarily can hardcode the version you want when using webdriver-manager, then tell protractor which version to use (since protractor can still try to install 85 and use it).
Here is the copied work-around:
We have webdriver-manager installed as project dependency (npm install --save-dev webdriver-manager)
we call webdriver-manager update --versions.chrome 84.0.4147.30 prior to running our tests. This will install the 84 chromedriver version in ./node_modules/webdriver-manager/selenium/. (We just made this as a npm script in our package.json)
We then update the protractor.conf file to have this line in the root of exports.config: chromeDriver:"./node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30.exe"**
Protractor still installs chromedriverr 85, but it will use the 84 version.
** In our case, we run our protractor tests in docker, but develop mostly on windows. So I updated the protractor.conf to have this line so that it works in either:
chromeDriver: process.platform === "win32" ? "./node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30.exe" : "./node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30"
I have had the same issue but it worked when I updated latest version of protractor which is 7.0.0

directConnect option is not working after upgrading to webdriver-manager 12.1.4

I used to run my protractor tests using directConnect: true option set.
The chromedriver I had at that time was chromedriver2.46
Now with the latest webdriver-manaegr12.1.4, the chromedriver was upgraded to ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729#{#29})
If I still continue to use directConnect: true and run my tests, I get the following error
session not created: This version of ChromeDriver only supports Chrome version 75
(Driver info: chromedriver=75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/branch-heads/3770#{#40}),platform=Mac OS X 10.14.4 x86_64)
Here is my very simple example: https://github.com/cnishina/protractor542-chrome74 It does not use a Docker container but it works for Chrome 74 with ChromeDriver 74.
Chrome browser + ChromeDriver versions
The output error message looks like session was not created because you are trying to use ChromeDriver 75. I would refer to http://chromedriver.chromium.org/downloads to match the ChromeDriver version to the Chrome browser version. The latest Chrome browser version is 74 so ChromeDriver downloads 74.0.3729.131. If you are still on Chrome browser 71-73, you could use ChromeDriver 2.46. Moving forward, the browser major version and chromedriver version must match. So for Chrome 73, you could use 73.0.3683.68.
Downloading different versions of ChromeDriver
If you need to download a different version of ChromeDriver, you could run the webdriver-manager command: webdriver-manager update --versions.chrome 73.0.3683.68 or to download 2.46, webdriver-manager update --versions.chrome 2.46.

Webdriver-Manager Start Certificate Error

I am getting the following error below when trying to start webdriver-manager.
It is working yesterday, after restarting it today, I am now getting a certificate error.
I enter --ignore_ssl, added proxy/https-proxy on User Variables and I already tried running the cmd as an administrator.
Error:
C:\Users\<user>\AppData\Roaming\npm>webdriver-manager start --ignore_ssl
events.js:160
throw er; // Unhandled 'error' event
^
Error: unable to get local issuer certificate at Error (native)
at TLSSocket.<anonymous> (_tls_wrap.js:1092:38)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:185:7)
at TLSSocket._finishInit (_tls_wrap.js:610:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)
When updating, I was able to update successfully without an error.
Fixed in webdriver-manager 12.0.5+:
This was an actual issue with webdriver-manager and was tracked as issue #229. On start, webdriver-manager would check the cache and if the cache was old, it would replace it. The problem identified above is that the ignore_ssl and proxy flags were not being passed.
The real issue is that webdriver-manager start should not be making any web requests. Removing web requests removed the need to pass the ignore_ssl and proxy flags around. So if a user were to test their web app locally on an airplane, starting the selenium server should still work.
Anyway, this has been resolved in PR #232 and we should have a new release (12.0.5) later today.
Update:
webdriver-manager version 12.0.5+ should have this fixed. The latest as of this update is 12.0.6. You can check what version you have installed with webdriver-manager version.
webdriver-manager version
webdriver-manager: using global installed version 12.0.5
[08:18:51] I/version - webdriver-manager 12.0.5
Troubleshooting
Potential errors could include having an old installed global version although you have installed a project dependency with the correct webdriver-manager version.
How do I know start makes no web requests? Well, other than unit tests, I have tried this out by turning off wifi and trying webdriver-manager start. If start fails for you at this point with no internet, please check your version.
webdriver-manager start --ignore_ssl
this will work for you.