selenium webdriver session not created: version mismatch fix
Fixes Selenium 'session not created' from driver/browser version mismatch. Use when the session fails to start. Not for mid-test disconnections.
TL;DR
The driver and browser versions disagree. Match them: use a driver manager that downloads the right driver automatically, or pin both versions explicitly.
Error
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 120Steps
- Check installed browser version and driver version. Expected: you see the mismatch.
- Use webdriver-manager (Python/JS) or Selenium Manager (built into Selenium 4.6+) to fetch the matching driver automatically. Expected: versions align.
- If pinned, update both pins together in CI. Expected: no drift between image browser and driver.
- Clear stale driver binaries from PATH that shadow the managed one. Expected: the right binary launches.
- Re-run session creation. Expected: session starts.
When to use
session not createdat startup with a version message.- After a browser auto-update.
When not to use
- Sessions die mid-test (different cause).
- Grid connection failures (hub issue).
Tool compatibility
- Selenium 4.x; Selenium Manager 4.6+; webdriver-manager.
Variant phrasings
ChromeDriver only supports Chrome version X
The version-specific form; align the two.
session not created: unable to discover open pages
The driver launched but the browser did not; check browser install.
Why it happens
Browsers auto-update; drivers do not. The protocol handshake requires matching versions.
Edge cases
- Selenium Manager needs network to download drivers; offline CI needs pre-baked images.
- Multiple Chrome channels (stable/beta) confuse auto-detection; set the binary path explicitly.
- Docker images with baked browsers must pin the driver in the same layer.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_2BGJBg-NKQceD6QDQjcsMw
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.