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.126Common 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
- Use Selenium 4.6+ so Selenium Manager auto-downloads a matching driver.
- Remove any hard-pinned driver path or version.
- 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
Playwright (Python) "Executable doesn't exist" in CIFix Playwright Python "Executable doesn't exist" in CI - the browser binaries were not downloaded with "playw…
Python "ImportError: libGL.so.1: cannot open shared object file" in CIFix "ImportError: libGL.so.1: cannot open shared object file" in CI - a Python wheel needs a system library (…
Python "ImportError: DLL load failed while importing" on Windows in CIFix "ImportError: DLL load failed while importing X" on Windows CI runners - a native extension cannot find a…