Encountering the “session not created: This version of ChromeDriver only supports Chrome version 74” error with ChromeDriver Chrome using Selenium can halt your automated testing and web scraping efforts dead in their tracks. This frustrating message indicates a fundamental incompatibility between the version of the Chrome browser installed on your system and the version of ChromeDriver your Selenium script is attempting to use. While the error specifically mentions Chrome version 74, this issue is a common pitfall that can occur with any version mismatch between Chrome and its corresponding ChromeDriver executable. Understanding the root cause—a critical synchronization requirement—is key to resolving it efficiently. This guide will walk you through diagnosing, troubleshooting, and implementing best practices to ensure your Selenium WebDriver setup runs smoothly, preventing future disruptions.
Understanding the “Session Not Created” Error
The “session not created” error, particularly when it specifies a Chrome version, is a direct signal that your Selenium script cannot establish a connection with the Chrome browser. This happens because ChromeDriver acts as a bridge, translating Selenium commands into actions that Chrome can understand. Each version of Chrome has specific internal protocols and functionalities, and ChromeDriver is developed to be compatible with a narrow range of Chrome versions. When you see a message like “This version of ChromeDriver only supports Chrome version 74,” it means the ChromeDriver executable you are using was built to work specifically with Chrome 74, but your installed Chrome browser is a different version.
This version of ChromeDriver only supports Chrome version 74 error with ChromeDriver Chrome using Selenium typically arises due to a version mismatch between your installed Chrome browser and the ChromeDriver executable. When Chrome updates automatically, or if you manually download a new ChromeDriver without updating the other component, this critical compatibility issue emerges. Selenium WebDriver requires a perfectly aligned driver executable to successfully launch and control the browser, making version synchronization paramount for stable browser automation errors.
Ignoring this compatibility issue can lead to unreliable test execution, unpredictable behavior, and complete failure of your automation scripts. It’s not merely a warning; it’s a hard stop that prevents any further interaction with the browser. Developers and QA engineers frequently face this challenge, highlighting the need for a systematic approach to managing browser and driver versions in their web testing environments.
Diagnosing Your Chrome and ChromeDriver Versions
Before you can fix the problem, you need to understand exactly which versions are clashing. Identifying the current version of your Chrome browser and the ChromeDriver executable you are using is the first and most crucial step in resolving the “session not created” error. This diagnostic process is straightforward but often overlooked, leading to prolonged troubleshooting.
Checking Your Chrome Browser Version
Determining your Chrome browser version is simple. Open Chrome, click on the three vertical dots (menu icon) in the top-right corner, navigate to “Help,” and then select “About Google Chrome.” A new tab will open, displaying your exact Chrome version number, for example, “Version 120.0.6099.109.” Note this number down carefully.
Regular Chrome browser updates are a common cause of this issue. Chrome often updates itself in the background without explicit user intervention, which can suddenly break existing Selenium automation scripts that were working fine moments before. This automatic update mechanism is convenient for security and features but problematic for fixed automation environments.
Checking Your ChromeDriver Version
To check your ChromeDriver version, you typically have two main scenarios. If you downloaded it manually, the version number is usually part of the filename (e.g., chromedriver_win32_120.0.6099.109.zip). If it’s already extracted and in your system’s PATH, you can open a command prompt or terminal and type chromedriver –version. This command will output the version of the driver executable, for instance, “ChromeDriver 120.0.6099.109.”
- Open Google Chrome.
- Click the three-dot menu (top-right).
- Go to Help > About Google Chrome.
- Note the full version number.
Once you have both version numbers, compare them. If your Chrome browser is version 120.x, but your ChromeDriver is for version 74.x (or any other mismatched version), then you have identified the exact ChromeDriver version mismatch that is causing the problem. The goal is to ensure the major version numbers (e.g., 120 in 120.0.6099.109) align between Chrome and ChromeDriver.
Step-by-Step Solutions to Resolve the Version Mismatch
Once you’ve diagnosed the version mismatch, resolving the “session not created: This version of ChromeDriver only supports Chrome version 74 error with ChromeDriver Chrome using Selenium” involves a clear set of actions. The primary solution is always to ensure that your ChromeDriver version precisely matches your Chrome browser version. This often means updating or replacing your existing ChromeDriver executable.
Updating ChromeDriver
The most common fix is to download the correct ChromeDriver version. The official ChromeDriver downloads page is your authoritative source. You should always aim to download the ChromeDriver version that matches your Chrome browser’s major version number. For example, if your Chrome is version 120.x.x.x, you need ChromeDriver 120.x.x.x.
- Identify Your Chrome Version: As discussed, check your Chrome browser’s “About Google Chrome” page.
- Visit the ChromeDriver Downloads Page: Go to the official ChromeDriver download page.
- Find the Matching Version: Look for the ChromeDriver release that supports your exact Chrome version. The page lists compatible Chrome versions for each ChromeDriver release.
- Download the Correct Executable: Download the appropriate zip file for your operating system (e.g., chromedriver_win32.zip for Windows, chromedriver_mac64.zip for macOS).
- Extract and Replace: Extract the chromedriver executable from the downloaded zip file. Replace your old chromedriver executable with this new one. Ensure it’s placed in the same directory as your previous driver or in a location included in your system’s PATH environment variable.
- Update Your Script (if necessary): If you explicitly specified the path to your old ChromeDriver in your Selenium WebDriver setup, update your script to point to the new executable’s location.
This process directly addresses the compatibility issues by providing the correct driver executable for your Chrome browser. Always ensure you are downloading from the official source to avoid security risks and ensure proper functionality.
Managing Chrome Browser Updates
While Chrome’s automatic updates are convenient, they can be a bane for automated testing environments. To prevent sudden breaks, consider managing Chrome updates more deliberately in dedicated testing machines. This might involve disabling automatic updates (though generally not recommended for security reasons) or using containerized environments (like Docker) where browser versions are explicitly controlled. For development, simply being aware of potential updates helps you proactively check for a new ChromeDriver when your scripts fail.
Another approach for robust Selenium WebDriver setup is to keep a specific version of Chrome browser installed, especially in CI/CD pipelines. This provides a stable environment, minimizing unexpected “session not created” errors. However, this requires more maintenance to ensure security patches are still applied. The core issue remains synchronization, so consistent version management is crucial for web testing.
Question & Answer :
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
For MacOS chromedriver upgrade did the trick:
brew upgrade --cask chromedriver