Skip to content
Latchkey

Selenium (Python) "session not created" in CI

Selenium asked the driver to start a browser session, but the driver refused - usually because the driver build only supports a different browser major version, or the browser binary is absent.

What this error means

A test fails with "selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version N."

python
selenium.common.exceptions.SessionNotCreatedException: Message: session not created:
This version of ChromeDriver only supports Chrome version 124
Current browser version is 126.0.6478.126

Common causes

Driver and browser major versions differ

ChromeDriver is locked to a Chrome major version; a runner-updated Chrome with an old pinned driver cannot create a session.

The browser binary is missing or wrong path

No browser is installed, or Selenium points at a path that does not exist on the runner.

How to fix it

Let Selenium Manager resolve the driver

  1. Use Selenium 4.6+ so Selenium Manager auto-downloads a matching driver.
  2. Remove any hard-pinned driver path or version.
  3. Re-run the test.
Python
# Selenium 4.6+ auto-resolves the matching driver
from selenium import webdriver
driver = webdriver.Chrome()

Pin matching browser and driver explicitly

If you manage versions yourself, install a browser and driver of the same major version.

.github/workflows/ci.yml
- uses: browser-actions/setup-chrome@v1
  with:
    chrome-version: '126'

How to prevent it

  • Use Selenium Manager (4.6+) to keep driver and browser in lockstep.
  • Avoid hard-pinning a driver version that the runner browser will outpace.
  • Install the browser explicitly so its presence is deterministic.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →