session not created: This version of ChromeDriver only supports Chrome version 74 error with ChromeDriver Chrome using Selenium
Asked Answered
R

24

201

I'm trying to run RSelenium using the rsDriver function, but when I run rD <- rsDriver() I get a message telling me I need a newer version of Chrome:

> rD <- rsDriver()
checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking chromedriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking geckodriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking phantomjs versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
[1] "Connecting to remote server"

Selenium message:session not created: This version of ChromeDriver only supports Chrome version 74
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Mac OS X 10.14.3 x86_64)

Could not open chrome browser.
Client error message:
     Summary: SessionNotCreatedException
     Detail: A new session could not be created.
     Further Details: run errorDetails method
Check server log for further details.

The error message appears to say that I need Chrome version 74.0.3729.6, but when I look in Chrome's settings, it tells me that I'm running the latest stable version (73.0.3683.75). Upon further googling, 74.0.3729.6 is a pre-release dev version of Chrome: do I need to install this in order to use ChromeDriver with RSelenium?

I'm not wedded to the idea of using Chrome, but I haven't been able to get rsDriver to use Firefox: when I specify browser = "firefox", rsDriver gives me the same error message about ChromeDriver not supporting my version of Chrome.

My session info is:

R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.3

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] wdman_0.2.4     forcats_0.3.0   stringr_1.3.1   dplyr_0.7.8     purrr_0.2.5     readr_1.3.1     tidyr_0.8.2    
 [8] tibble_2.0.1    ggplot2_3.1.0   tidyverse_1.2.1 rvest_0.3.2     xml2_1.2.0      RSelenium_1.7.5
Ritzy answered 16/3, 2019 at 20:31 Comment(9)
Download this old version. Works fine! >>---> chromedriver.storage.googleapis.com/index.html?path=2.46Wicker
in my case, if error says it only supports version 76, i can't use chrome 76.xxx. if i downgrade to 75.xxx, it says it only supports version 75. If i try the latest version (78 currently), it worksHedvige
@Hedvige which version of selenium and Python are used? I hit the same issue though the version of Chrome is 78.0.3904.70Irascible
@Irascible Selenium 3.141.0, Python 3.7.3, Chrome 78.0.3904.70 (currently, but not sure what it was at that moment)Hedvige
If you have choco you can "choco update chromedriver"Mauricemauricio
The easiest way i found today is just check your chrome version and download web - driver and copy that to c:/programfiles/python/.. and use this path to your script ...... really working for me.Routh
This helped me install the lasted Google Chrome on Ubuntu via command line: askubuntu.com/a/510063/48214Intern
Use this to update both Chromedriver and Chrome to latest on Ubuntu/Linux: https://mcmap.net/q/67231/-how-to-work-with-a-specific-version-of-chromedriver-while-chrome-browser-gets-updated-automatically-through-python-seleniumVicentevicepresident
I checked the version of my google chrome browser installed on my pc and then downloaded ChromeDriver suited to my browser version. You can download it from chromedriver.chromium.orgSchmitt
C
46

I encountered the same issue today and found this post and others from Google. I think I may have a more direct solution as a modification of your code. The previous answer is correct in identifying the mismatch in versions.

I tried the proposed solutions to no avail. I found that the versions were correct on my computer. However, this mismatch error was not resulting from the actual versions installed on the computer, but rather the RSelenium code is seeking the "latest" version of Chrome/ChromeDriver by default argument. See ?rsDriver() help page for the arguments.

If you run the code binman::list_versions("chromedriver") as specified in the help documentation, then you can identify the versions of compatible with the function. In my case, I was able to use the following code to establish a connection.

driver <- rsDriver(browser=c("chrome"), chromever="73.0.3683.68", extraCapabilities = eCaps)

You should be able to specify your version of Chrome with the chromever= argument. I had to use the closest version, though (my chrome version was "73.0.3683.75").

Hope this helps!

Cibis answered 17/3, 2019 at 22:50 Comment(5)
CAD's answer worked for me with the caveat chrome://settings/help to view and/or update your Chrome browser version. In my case I clicked updated to update to Version: 73.0.3683.86 (Official Build) (64-bit)Grueling
It seems that your variant is more suitable for my case. But I can not find how to say to protractor to use a version defined. Like this chromever="73.0.3683.68". In my case. I use lower version chromium-browser than protractor asks. This is my case #55985424Decamp
Yo, sir,rock. I modifed this code slightly to always use the latest version with: available.versions<-binman::list_versions("chromedriver") latest.version = available.versions$win32[length(available.versions)] Thanks for this!Hugmetight
Run the code binman::list_versions("chromedriver") where? As specified in what documentation?Hothouse
I use: rsDriver(chromever = binman::list_versions("chromedriver")$win32[4])Macerate
P
88

For MacOS chromedriver upgrade did the trick:

brew upgrade --cask chromedriver
Perkin answered 2/8, 2019 at 7:22 Comment(5)
Nice, this got me on the right track except I was using chromedriver-beta, which was expecting a later version of Chrome. So what I did: brew cask uninstall chromedriver-beta; brew cask install chromedriverGoatherd
This only works if you installed chromedriver via brew. I had installed it via a direct download, so first ran rm /usr/local/bin/chromedriver and then brew cask install chromedriver to get the latest version. In any case, upgrading chromedriver was the solution.Dykstra
this should be the accepted answer instead of the one suggesting to downgrade chromeDecadent
This fixed my issue.Ruskin
As of 2021, if you get the error Error: Unknown command: cask, you need instead to run the command: brew reinstall chromedriver. See #30414121 for more info. Fyi, the new cask install syntax is: brew install --cask chromedriverUnborn
M
74

This error message...

Selenium message:session not created: This version of ChromeDriver only supports Chrome version 74
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Mac OS X 10.14.3 x86_64)

...implies that the ChromeDriver expects the Chrome Browser version to be 74.


Quick installation of the latest ChromeDriver

To install the latest version of ChromeDriver you can use:

  • Mac users with Homebrew: brew tap homebrew/cask && brew cask install chromedriver
  • Debian based Linux distros: sudo apt-get install chromium-chromedriver
  • Windows users with Chocolatey installed: choco install chromedriver

Analysis

Your main issue is the incompatibility between the version of the binaries you are using as follows:

Supports Chrome v74

  • You are using the currently released chrome=73.0

So there is a clear mismatch between the ChromeDriver v74.0.3729.6 and the Chrome Browser v73.0


Solution

  • Downgrade ChromeDriver to ChromeDriver v73.0.3683.68 level.
  • Keep Chrome version at Chrome v73 level. (as per ChromeDriver v73.0.3683.68 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
  • Execute your @Test.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

Reference

You can find a relevant detailed discussion in:

Metrify answered 16/3, 2019 at 20:49 Comment(8)
I've downgraded ChromeDriver to v73.0.3683.68, cleaned the project workspace, and rebuilt it with only the required dependencies. It now gives me a different error message when I run rD <- rsDriver(), ending in: [1] "Connecting to remote server" Could not open chrome browser. Client error message: Undefined error in httr call. httr output: Failed to connect to localhost port 4567: Connection refused Check server log for further details. Warning message: In rsDriver() : Could not determine server status.Ritzy
Also apologies if this is obvious (this is my first time trying to do anything like this), but what is the Web Client and what is a GA? Additionally, what is the @Test and can I run this within RStudio?Ritzy
Web Client -> Chrome Browser, GA -> General Avaiibility , @Test -> An annotation used to identify a test using JUnit / TestNG (you can simply consider as test)Metrify
This is just a generic answer about how to troubleshoot version mismatches when using Selenium. This answer doesn't refer to R or RSelenium at all. This accepted answer should be the one by @CAD below.Kirbee
For updating Chromedriver on Ubuntu, use this: #48649730Vicentevicepresident
Make sure you check what version your Chrome browser is, then go the Chrome Driver page to download the compatible driver for your browser version chromedriver.chromium.org/downloadsBoden
+1 for the explanation (teach a man to fish and all that). I upgraded my chromedriver to match my chrome version (Chrome Help -> About - version) and it was fixed.Uriiah
Just to sync up, the first command for mac can be replaced with brew tap homebrew/cask && brew install --cask chromedriverTrishatriskelion
C
46

I encountered the same issue today and found this post and others from Google. I think I may have a more direct solution as a modification of your code. The previous answer is correct in identifying the mismatch in versions.

I tried the proposed solutions to no avail. I found that the versions were correct on my computer. However, this mismatch error was not resulting from the actual versions installed on the computer, but rather the RSelenium code is seeking the "latest" version of Chrome/ChromeDriver by default argument. See ?rsDriver() help page for the arguments.

If you run the code binman::list_versions("chromedriver") as specified in the help documentation, then you can identify the versions of compatible with the function. In my case, I was able to use the following code to establish a connection.

driver <- rsDriver(browser=c("chrome"), chromever="73.0.3683.68", extraCapabilities = eCaps)

You should be able to specify your version of Chrome with the chromever= argument. I had to use the closest version, though (my chrome version was "73.0.3683.75").

Hope this helps!

Cibis answered 17/3, 2019 at 22:50 Comment(5)
CAD's answer worked for me with the caveat chrome://settings/help to view and/or update your Chrome browser version. In my case I clicked updated to update to Version: 73.0.3683.86 (Official Build) (64-bit)Grueling
It seems that your variant is more suitable for my case. But I can not find how to say to protractor to use a version defined. Like this chromever="73.0.3683.68". In my case. I use lower version chromium-browser than protractor asks. This is my case #55985424Decamp
Yo, sir,rock. I modifed this code slightly to always use the latest version with: available.versions<-binman::list_versions("chromedriver") latest.version = available.versions$win32[length(available.versions)] Thanks for this!Hugmetight
Run the code binman::list_versions("chromedriver") where? As specified in what documentation?Hothouse
I use: rsDriver(chromever = binman::list_versions("chromedriver")$win32[4])Macerate
W
33

Updating the Google Chrome version to 74 worked for me.

Steps: 1. Go to Help -> About Google Chrome -> Chrome will automatically look for updates(update Chrome to the latest version)

enter image description here

Whydah answered 1/5, 2019 at 9:25 Comment(0)
C
23

I had to reinstall protractor for it to pull the updated webdriver-manager module. Also, per @Mark’s comment, the package-lock.json may be locking the dependency.

npm uninstall protractor
npm install --save-dev protractor

Then, make sure to check the maxChromedriver value in node_modules/protractor/node_modules/webdriver-manager/config.json after re-install to verify it matches the desired Chrome driver version.

Comforter answered 25/9, 2019 at 19:57 Comment(0)
M
15

Update

I've submitted a pull request to RSelenium adding the ChromeDriver version selection logic proposed in my original answer. Until it gets merged (if at all), you can install it with

remotes::install_github("ropensci/RSelenium#237")

Then you can call rsDriver() with the new chromever = "latest_compatible" option which should always select the right ChromeDriver version:

RSelenium::rsDriver(browser = "chrome",
                    chromever = "latest_compatible")

Original answer

I ran into the same kind of error using RSelenium::rsDriver()'s default chromever = "latest" setting which resulted in the failed attempt to combine chromedriver 75.0.3770.8 with latest google-chrome-stable 74.0.3729.157:

session not created: This version of ChromeDriver only supports Chrome version 75

Since this obviously seems to be a recurring and pretty annoying issue, I have come up with the following workaround to always use the latest compatible ChromeDriver version:

rD <- RSelenium::rsDriver(browser = "chrome",
                          chromever =
                                  system2(command = "google-chrome-stable",
                                          args = "--version",
                                          stdout = TRUE,
                                          stderr = TRUE) %>%
                                  stringr::str_extract(pattern = "(?<=Chrome )\\d+\\.\\d+\\.\\d+\\.") %>%
                                  magrittr::extract(!is.na(.)) %>%
                                  stringr::str_replace_all(pattern = "\\.",
                                                           replacement = "\\\\.") %>%
                                  paste0("^",  .) %>%
                                  stringr::str_subset(string =
                                                              binman::list_versions(appname = "chromedriver") %>%
                                                              dplyr::last()) %>%
                                  as.numeric_version() %>%
                                  max() %>%
                                  as.character())

The above code is only tested under Linux and makes use of some tidyverse packages (install them beforehand or rewrite it in base R). For other operating systems you might have to adapt it a bit, particularly replace command = "google-chrome-stable" with the system-specific command to launch Google Chrome:

  • On macOS it should be enough to replace command = "google-chrome-stable" with command = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome".

  • On Windows a plattform-specific bug prevents us from calling the Google Chrome binary directly to get its version number. Instead do the following:

    rD <- RSelenium::rsDriver(browser = "chrome",
                              chromever =
                                system2(command = "wmic",
                                        args = 'datafile where name="C:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe" get Version /value',
                                        stdout = TRUE,
                                        stderr = TRUE) %>%
                                stringr::str_extract(pattern = "(?<=Version=)\\d+\\.\\d+\\.\\d+\\.") %>%
                                magrittr::extract(!is.na(.)) %>%
                                stringr::str_replace_all(pattern = "\\.",
                                                         replacement = "\\\\.") %>%
                                paste0("^",  .) %>%
                                stringr::str_subset(string =
                                                            binman::list_versions(appname = "chromedriver") %>%
                                                            dplyr::last()) %>% 
                                as.numeric_version() %>%
                                max() %>%
                                as.character())
    

Basically, the code just ensures the latest ChromeDriver version matching the major-minor-patch version number of the system's stable Google Chrome browser is passed as chromever argument. This procedure should adhere to the official ChromeDriver versioning scheme. Quote:

  • ChromeDriver uses the same version number scheme as Chrome (...)
  • Each version of ChromeDriver supports Chrome with matching major, minor, and build version numbers. For example, ChromeDriver 73.0.3683.20 supports all Chrome versions that start with 73.0.3683.
Manchineel answered 16/5, 2019 at 17:44 Comment(2)
The hero we need. Thanks! P.S: I edited to include the Windows code to make it easier for future readersPublish
👍 I've just integrated it properly since you've succesfully tested it!Manchineel
H
9

I dealed with this issue today and upgrading my webdrivermanger solved it for me (My previous version was 3.0.0):

<dependency>
    <groupId>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>3.3.0</version>
    <scope>test</scope>
</dependency>
Housekeeping answered 18/3, 2019 at 5:56 Comment(4)
I've resolved the same issue by upgrading to 3.3.0 version,Thank youSplore
I was on version 1.x. Updating to 3.3.0 fixed it for me as well.Carte
You have to use the latest version which is <version>3.6.2</version>.Vibratile
I think this answer would be vastly improved by including steps on how one might go about upgrading their "webdrivermanager." All you've done here is provided some XML without much in the way of explanation. Would you mind updating this answer with some additional details? Thanks.Hugmetight
D
4

Travis CI alternative

Another answer since Francesco Borzi's didn't work for me.

Add this to your travis.yml:

addons:
  chrome: stable

before_script:
  - LATEST_CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE"`
  - curl "https://chromedriver.storage.googleapis.com/${LATEST_CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" -O
  - unzip chromedriver_linux64.zip -d ~/bin

Many thanks and credit to tagliala on github:

https://github.com/diowa/ruby2-rails5-bootstrap-heroku/commit/6ba95f33f922895090d3fabc140816db67b09672

Dykstra answered 20/8, 2019 at 15:52 Comment(0)
G
3

I was really struggling with this mismatch between ChromeDriver v74.0.3729.6 and the Chrome Browser v73.0. I finally found a way to get ChromeDriver to an earlier version,

  1. In Chrome > About Google Chrome, copy the the version number, except for the last group. For instance, 72.0.3626.

  2. Paste that version at the end of this url and visit it. It will come back with a version, which you should copy. https://chromedriver.storage.googleapis.com/LATEST_RELEASE_

  3. Back in the command line, run bundle exec chromedriver-update <copied version>

Garneau answered 20/3, 2019 at 18:43 Comment(1)
I fount the solution, and taught - there must be an answer like this already :)Minh
W
3

Travis CI

I had the same issue in Travis and solved by adding:

addons:
  chrome: stable

to my .travis.yml file.

Weinert answered 15/5, 2019 at 18:26 Comment(1)
R
3
$ which chromedriver
/usr/local/bin/chromedriver
$ chromedriver --version
ChromeDriver 78.0.3904.105

I downloaded a zip file from https://chromedriver.chromium.org/downloads It says "If you are using Chrome version 79, please download ChromeDriver 79.0.3945.36" and I was using Chrome version 79. (I checked chrome://settings/help) Apparently, the error for me was "This version of ChromeDriver only supports Chrome version 78"

And then I clicked the zip file and move that "chromedriver" file into /usr/local/bin/ directory. That solved the issue.

$ which chromedriver
$ chromedriver --version
ChromeDriver 79.0.3945.36
Rhythm answered 11/2, 2020 at 19:10 Comment(0)
H
2

This solution worked for me

  1. Make sure you're using R 3.5.3 or greater
  2. driver <- rsDriver(browser=c("chrome"), chromever="73.0.3683.68")
Hybridize answered 2/4, 2019 at 2:43 Comment(0)
M
2

Ran into this issue and was able to solve by 2 main steps:

1 - Update to latest chromedriver via homebrew cli

brew cask upgrade chromedriver

2 - update to lastest ver via Chrome GUI

chrome://settings/help or cmd + , then tacking on help at the end (your choice)

from there you should land on the About Chrome Page. Here you will need to verify that you are on the latest and greatest version (problem i was running into stemmed from a mismatch in the cli vs the current chrome version)

if you getting the error, you will see a update & relaunch primary action button.

after chrome "relaunches" it will now have the newest version matching your cli

example:

Google Chrome is up to date
Version 80.0.3987.87 (Official Build) (64-bit)
Mateya answered 10/2, 2020 at 17:29 Comment(0)
E
1

I got the same error when I am using robot framework (Selenium based framework) in a Docker instance. The reason was docker was using cached google-chrome-stable_current_amd64.deb for Chrome but it has installed latest chrome driver which was a later version.

Then I used below command and error resolved.

docker-compose build --no-cache

Hope this helps someone.

Epilimnion answered 11/6, 2019 at 2:38 Comment(0)
S
1

I was facing the same error:

session not created: This version of ChromeDriver only supports Chrome version 75

...

Driver info: driver.version: ChromeDriver

We are running the tests from a computer that has no real UI, so I had to work via a command line (CLI).

I started by detecting the current version of Chrome that was installed on the Linux computer:

$> google-chrome --version

And got this response:

Google Chrome 74.0.3729.169

So then I updated the Chrome version like that:

$> sudo apt-get install google-chrome-stable

And after checking again the version I got this:

Google Chrome 75.0.3770.100

Then the Selenium tests were able to run smoothly.

Silvana answered 26/6, 2019 at 5:57 Comment(1)
This is applicable when the chrome browser was installed via repo/ppa and cannot update itselfLoar
H
1

There's no need to downgrade Chrome anymore, when you get this error only means it's time to run webdriver-manager update again

Haddix answered 9/8, 2019 at 11:54 Comment(0)
F
1

Just update protractor:

npm install protractor@latest --save-dev
Flywheel answered 20/9, 2019 at 17:33 Comment(0)
S
1

You can specify the exact version of your Chrome installation like this:

webdriver-manager update --versions.chrome 73.0.3683.75

Maybe you need to do a webdriver-manager clean first in the case of a downgrade.

Superficial answered 9/12, 2019 at 11:40 Comment(0)
N
1

I had the same problem and solved it by simply downloading a chromedriver file for a previous version of chrome. I have found that version 79 of Chrome is compatible with the current version of Selenium.

I then saved it in a specified path, and linked that path to my webdriver.

The exact steps are specified in this link: http://chromedriver.chromium.org/downloads

Ney answered 14/1, 2020 at 22:24 Comment(0)
B
0

I have almost the same problems like this, the problems is come inside the pipeline when running my selenium test that need chromedriver package to running the e2e test.

My error build pipeline

The problems is just because in the pipeline (in my case) is having the chrome version 73, and my chromedriver package is installed on version 74.

Finally there are two simple solutions:

  1. Downgrade your chrome
  2. Downgrade your chromedriver package version. in my case, cause i running inside the pipeline i need to install chromedriver before running the selenium test like displayed below.

    - script: npm install [email protected] --chromedriver-force-download displayName: 'Install Chrome'

Boulder answered 14/5, 2019 at 4:10 Comment(3)
I am having a same problem, How to know the chrome -version on the Jenkins node?Overdraw
How to install a chrome on the node as a part of build pipeline if there is no chromeOverdraw
to install a chrome as a part of build pipeline you can just add the task script i've put above.Boulder
A
0

The same problem happened to me today.

My solution:

Download the latest stable release of chromedriver: https://sites.google.com/a/chromium.org/chromedriver/

Update the chrome driver on your Selenium folder. This is a bit hard, because is in a hidden folder on your PC called AppData. Here is how I did it in my computer (Windows 7):

C: > users > your user > \AppData (you need to write this in the folder path box, since it is a hidden folder) > Local (this is the folder name in portuguese, maybe it will have a different name for you) > SeleniumBasic

There you will find the chromedriver application. Just rename it (in case it does not work, you want to have the older version) and than paste the newest release.

Alizaalizarin answered 7/11, 2019 at 14:6 Comment(0)
C
0

I had the very same issue recently. This was my error:

System.InvalidOperationException : session not created: This version of ChromeDriver only supports Chrome version 76 (SessionNotCreated)

This fix worked for me:

  • make sure there are no running chromedriver.exe processes (if needed kill them all e.g. via task manager)
  • go to bin folder and delete chromedriver.exe file from there (in my case it was: [project_folder]\bin\Debug\netcoreapp2.1)
Cule answered 2/12, 2019 at 8:37 Comment(0)
L
0

Make sure You have the latest version of webdriver-manager. You can install the same using npm i webdriver-manager@latest --save

Then run the following

command.webdriver-manager update
Lucais answered 24/12, 2019 at 12:28 Comment(0)
T
0

I had similar problem on my mac os bigsur In 2021, on mac the correct command is

brew upgrade --cask chromedriver 
Trothplight answered 3/3, 2021 at 11:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.