Skip to content

Resolving ChromeDriver Version Mismatch in Selenium

Problem Statement

When using Selenium for browser automation, you may encounter a version compatibility error:

python
selenium.common.exceptions.SessionNotCreatedException: 
This version of ChromeDriver only supports Chrome version 114. LATEST_RELEASE_115 doesn't exist

This error occurs when:

  1. Your Chrome browser version is newer than your ChromeDriver version
  2. ChromeDriverManager fails to find a compatible driver version
  3. Your Selenium version doesn't support the new Chrome for Testing infrastructure
  4. Your ChromeDriver path is configured incorrectly

The core issue is a version mismatch between Chrome and ChromeDriver, exacerbated by changes in Google's driver distribution since Chrome 115.

Version Compatibility Critical

Your ChromeDriver version must exactly match your major Chrome browser version (e.g., Chrome 123 requires ChromeDriver 123). Google now distributes versions through the Chrome for Testing project.

1. Update Selenium and Use Auto-Managed ChromeDriver (Best Practice)

Chrome for Testing Support

Since Selenium 4.11.2, the Service() class can automatically download and manage the correct ChromeDriver version through the Chrome for Testing infrastructure.

  1. First upgrade Selenium:

    bash
    pip install -U selenium==4.11.2
    # Or install the latest version
    pip install -U selenium
  2. Use this simplified code structure:

    python
    from selenium import webdriver
    from selenium.webdriver.chrome.service import Service
    from selenium.webdriver.chrome.options import Options
    
    options = Options()
    options.add_argument("--headless=new")  # Optional: run headless
    
    service = Service()  # Auto-manages driver version
    driver = webdriver.Chrome(service=service, options=options)
    
    driver.get("https://example.com")
    # Your automation code here
    
    driver.quit()

Key advantages:

  • No manual driver downloads
  • Automatically handles version matching
  • Uses Google's official stable channels

2. Manually Install Correct ChromeDriver Version

When you need explicit version control:

  1. Check your Chrome version:
    Visit chrome://settings/help in browser

  2. Download matching driver from the official source:
    https://googlechromelabs.github.io/chrome-for-testing/

  3. Configure driver path directly:

    python
    from selenium import webdriver
    from selenium.webdriver.chrome.service import Service
    
    # Extract downloaded driver to known path
    chrome_driver_path = "/path/to/chromedriver.exe"  # Windows
    # chrome_driver_path = "/usr/bin/chromedriver"    # Linux
    # chrome_driver_path = "chromedriver_mac64"       # macOS
    
    service = Service(executable_path=chrome_driver_path)
    driver = webdriver.Chrome(service=service)

3. Using undetected-chromedriver (For Bypassing Detection)

When automating undetected browsers:

python
import undetected_chromedriver as uc

# Must use explicit path to downloaded driver
driver = uc.Chrome(
    driver_executable_path=r"path/to/chromedriver",
    version_main=115,  # Manually specify major version if needed
    options=options
)

Ensure you have the latest package:

bash
pip install -U undetected-chromedriver

Common Errors and Fixes

Incorrect Driver Path Specification

Path Configuration

Specify the executable file, not just its directory:

❌ Incorrect:

python
service = Service("C:/drivers/chromedriver-win64/")

✅ Correct:

python
service = Service("C:/drivers/chromedriver-win64/chromedriver.exe")

Persisting Browser/Driver Mismatch

Force specific browser version if necessary:

python
options = Options()
options.binary_location = r"C:/chrome-for-testing/chrome.exe"

Best Practices to Prevent Issues

  1. Use explicit version pinning in CI/CD:

    bash
    # Install specific Chrome version
    wget https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/linux64/chrome-linux64.zip
  2. Avoid disabling browser updates: Instead manage through:

  3. Implement compatibility checks:

    python
    from selenium import __version__ as selenium_version
    print(f"Selenium: {selenium_version}")  # Should be ≥4.11.2

Deprecated Methods

Avoid outdated executable_path parameter:

python
# DEPRECATED - DO NOT USE
driver = webdriver.Chrome(executable_path="chromedriver.exe")

Summary Recommendation

For most users: Update to Selenium 4.11.2+ and use Service() without arguments. This automatically resolves ~90% of versioning issues. Reserve manual driver management for special cases requiring explicit version control.

The Chrome for Testing project (https://googlechromelabs.github.io/chrome-for-testing/) should be your authoritative source for browser/driver binaries.