Using google-chrome-beta instead of stable in Protractor - selenium

When trying to run Protractor tests, I get an
Error: SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 80
Running Ubuntu with google-chrome stable version 79 and google-chrome-stable version 80 installed. Since I get the error, protractor seems to be trying to use the stable version, can I tell Protractor to use the beta version? Probably in the protractor.conf.js but not sure how, can't seem to find anything either.

Related

Selenium - chromedriver and google-chrome: error on same versions

I have google-chrome and chromedriver installed on EC2, and they both have the same version.
$ google-chrome-stable -version
Google Chrome 109.0.5414.74
$ chromedriver -v
ChromeDriver 109.0.5414.74 (e7c5703604daa9cc128ccf5a5d3e993513758913-refs/branch-heads/5414#{#1172})
But once I run a Selenium script, it fails with the following error:
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:47871
from session not created: This version of ChromeDriver only supports Chrome version 110
Current browser version is 109.0.5414.74
How is it possible since I have a single version of chromedriver which is installed in /usr/bin?
import undetected_chromedriver as uc
uc.Chrome(options=options, executable_path='/usr/bin/chromedriver')
From the console though it seems you are using ChromeDriver 109.0.5414.74:
$ chromedriver -v
ChromeDriver 109.0.5414.74 (e7c5703604daa9cc128ccf5a5d3e993513758913-refs/branch-heads/5414#{#1172})
But somewhere in your program or within the framework settings ChromeDriver v110.0.5481.77 is/gets downloaded and is being used to initiate the ChromeDriver / google-chrome session.
As per the Release Notes of ChromeDriver 110.0.5481.77 (2023-02-08):
Supports Chrome version 110
Where as you are still using Version 109.0.5414.120. Hence the mismatch and the error.

SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 97 Current browser version is 100.0.4896.75

I'm trying to start a selenium webdriverinstance, but I get this error:
SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 97 Current browser version is 100.0.4896.75 with binary path *path here*
I already tried using chromium 98, it works, but a new vulnerability was found in version 100 and i would like to update
This error message...
SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 97 Current browser version is 100.0.4896.75 with binary path...
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. google-chrome session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chrome=100.0.4896.75
You are using chromedriver=97.0
Release Notes of chromedriver=97.0 clearly mentions the following :
Supports Chrome version 97
So there is a clear mismatch between chromedriver=97.0 and the chrome=100.0.4896.75
Solution
Ensure that:
ChromeDriver is updated to ChromeDriver v100.0.4896.60 level which matches to chrome=100.0.4896.75.
On a mac M1, I was getting the following error:
Selenium::WebDriver::Error::SessionNotCreatedError:
session not created: This version of ChromeDriver only supports Chrome version 103
Current browser version is 105.0.5195.125 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
(Driver info: chromedriver=103.0.5060.134 (8ec6fce403b3feb0869b0732eda8bd95011d333c-refs/branch-heads/5060#{#1262}),platform=Mac OS X 12.5.1 arm64)
I simply upgraded the chromedriver using brew and it fixed the issue for me.
brew upgrade chromeDriver
In case this helps others, yum install chromium installed Chromium version 102 while npm install -g chromedriver installs version 103, which requires chromium version 103.
I'm sure rolling back to older versions is not the best solution, but for me, installing the complementary version of chromedriver got things running on my system. To install the older version of chromedriver that would align with the chromium version installed by yum, I first went here https://chromedriver.chromium.org/downloads and copied the version number for 102 (in this case 102.0.5005.61)
Then, installing the "correct" version of chromedriver was accomplished by running
CHROMEDRIVER_VERSION=102.0.5005.61 npm install -g chromedriver
Just in case if both Chrome browser version and ChromeDriver versions are in sync, then maybe you should look for the directory from where you project is invoking it, means there could some other directory from where ChromeDriver is being executed and whose version is incompatible with the browser.
In my case, my VS Code was picking up ChromeDriver from project's directory node_modules/.bin/ChromeDriver, so i replaced this with the latest and it worked.
For me the problem was that i updated the chromedriver to the newest chrome version via:
npm run e2e:update-webdriver which executes: webdriver-manager update --gecko false
Therefore, the chromedriver version was higher than the chrome browser version. To fix this discrepancy I had to run:
sudo apt-get update and then sudo apt-get --only-upgrade install google-chrome-stable
Hope this helps someone!

Chromedriver can’t be opened because Apple cannot check it for malicious software

Environment:
OS : Big Sur 11.1
Homebrew 3.2.13
Python 3.9.7
Command:
chromedriver —version
Error GUI Alert:

Error via output of .py file attempt to run chromedriver:
raise WebDriverException(selenium.common.exceptions.WebDriverException: Message: Service /opt/homebrew/bin/chromedriver unexpectedly exited. Status code was: -9
Fix Method (1)
As stated in the alert, try updating chromedriver:
Uninstall the current version:
brew uninstall chromedriver
Verify that chromedriver is uninstalled:
brew info chromedriver
Install the newest version of chromedriver:
brew install chromedriver
You can also try:
brew reinstall chromedriver
Fix Method (2) : Still Stuck
If you are still experiencing the issue, this fix helped me.
Determine which chromedriver is being used, run:
which chromedriver
Result :
/opt/homebrew/bin/chromedriver
Use the path to chromedriver in the following command to unblock it.
xattr -d com.apple.quarantine /opt/homebrew/bin/chromedriver
Now run the following:
chromedriver —version
Result :
ChromeDriver 93.0.4577.63
Chromedriver should successfully execute.
Reference
coorasse's answer.
For downloading from the chrome drive website
this one worked for me for MAC m1 chip
Use the path to chromedriver in the following command to unblock it.
xattr -d com.apple.quarantine path/to/chromedrive
I had the same issue this morning, this is what fixed it for me.
Go to the system and preferences -> security and privacy.
Then under general tab you will see a notification that about the
exec you are trying to open.
Just click "open anyway" there.
Go back to the chromedriver exe and open it it will then give you the same error but along with that you will get an option to open it.
Click Open and it should resolve.
Worked for me.

Chromium-browser version 83 on Raspbian

I am trying to do browser automation on a raspberry pi 3b using selenium and chromedriver.
I am using chromedriver version 9.3.2 which apparently needs chrome version 83. I now want to install chromium-browser version 83 onto my raspberry pi in order to successfully run my browser-automation. Can anyone tell me, where I can find and install chromium-browser 83, or where I can find a newer version of chromedriver which will work with chromium-browser version 86?
Thanks a lot in advance!
I seem to have found a/the solution to this problem.
Since I started using selenium for browser automation I always tried to install certain versions of chromedriver as well as chromium-browser as I have read that this specific combination seems to be working for raspbian.
As it turns out, there is a possibility to always have a working latest-version setup:
Run:
sudo apt-get install chromium-chromedriver
to get the latest chromedriver, then run:
sudo apt-get install chromium-browser
to get the latest version of the chromium browser.
This should be it for successfully running selenium in Python.
Date today (29.12.2020) versions for chromedriver and chromium-browser are
86.0.4240.197-rpt1.
Hope this is helpfull.

ChromeDriver unzipping 85.0.4183.38 version instead of 84.0.4147.89 using WebdriverManager for Selenium Protractor

I am trying to execute webdirver-manager update command. But chrome driver unzipping 85.0.4183.38 instead of 84.0.4147.89 as my chrome browser version is 84.0.4147.89.
I tried the following:
Webdriver-manager update --version.chrome=84.0.4147.89
a. Downgrading the driver for browser compatible version.
Uninstalling & reinstalling Chrome
Uninstalling & reinstalling chromedriver / protractor / webdriver
Webdriver-manager update --version.chrome 2.28
a. Downgrading the driver for browser version 54+
Still I am getting the error:
E/launcher - session not created: This version of ChromeDriver only supports Chrome version 85
Please help on this.
This isn't the usual case when you use Protractor. However as per the discussions in:
Protractor 7.0.0 only supports chrome verison 85, while chrome version is 85 (error)
webdriver-manager update downloads an incompatible version of chromedriver
As of now there seems to be some discrepancy in downloading the latest stable ChromeDriver. The ChromeDriver - WebDriver for Chrome repository clearly suggests:
Current stable release: ChromeDriver 84.0.4147.30
Current beta release: ChromeDriver 85.0.4183.38
So as the current google-chrome browser version is Version 84.0.4147.89, ChromeDriver 84.0.4147.30 should have been downloaded and installed.
Solution
As per #Fuun347's comment the solution is to:
Add version arguments to the webdriver-manager update and start commands. Updating and starting your webdriver with these commands will force the version to always be 84:
webdriver-manager update --versions.chrome=84.0.4147.30
webdriver-manager start --versions.chrome=84.0.4147.30
Note: Running ng e2e --project=e2e-no-serve --specs=./src/service/ --webdriverUpdate=false will stop the angular-cli from trying to update the webdriver.
Further, #TylerNielsen in his comment added:
The following worked for us:
We have webdriver-manager installed as project dependency.
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"
Please re download chrome driver exe according to your browser version (https://chromedriver.chromium.org)Your browser versions are updating time to time so you need to use exact driver exe.