Solution 1: Use same ChromeDriver and Chrome Browser Version You need to Use the same ChromeDriver and Chrome Browser Version This Error Only Occurs Cause Of Dirrenece between Your Chrome and Your WebDriver Version Mismatch. Please Make Sure Your ChromeDriver is up to date with ChromeDriver v102 in this version.
Through WebDriver, Selenium supports all major browsers on the market such as Chrome/Chromium, Firefox, Internet Explorer, Edge, Opera, and Safari.
For MacOS chromedriver upgrade did the trick:
brew upgrade --cask chromedriver
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.
To install the latest version of ChromeDriver you can use:
brew tap homebrew/cask && brew cask install chromedriver
sudo apt-get install chromium-chromedriver
choco install chromedriver
Your main issue is the incompatibility between the version of the binaries you are using as follows:
Supports Chrome v74
So there is a clear mismatch between the ChromeDriver v74.0.3729.6 and the Chrome Browser v73.0
@Test
.driver.quit()
within tearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.You can find a relevant detailed discussion in:
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!
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)
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.
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")
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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With