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.
Related
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!
Getting the error while running the script.
session not created: This version of ChromeDriver only supports Chrome version 89
Current browser version is 91.0.4472.77
Looks like your ChromeDriver is outdated.
The latest stable release(ChromeDriver) is ChromeDriver 90.0.4430.24
Latest beta release: ChromeDriver 91.0.4472.19
Get it from here
If you are working with selenium using python then I would recommend a python package webdriver-manager. You can install it using pip : pip install webdriver-manager Once the package is installed, you won't need to specify the chromedriver path or download chromdriver.exe Just use the below lines in your script and the plugin will identify the version of chrome browser installed in your system:
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get("google.com")
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.
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.
So far I have written the code in Google Colab like this but It just doesn't load the chrome web driver and open a chrome browser.
!apt-get update
!apt install chromium-chromedriver
!cp /usr/lib/chromium-browser/chromedriver /usr/bin
!pip install selenium
from selenium import webdriver
driver = webdriver.Chrome('chromedriver')
But it throws an exception stating
WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
"If I set the options to --headless it works fine, But I need to load a chrome browser to observe the automation flow."