How to Fix Selenium Screenshots with a ChromeDriver Session Not Created Error
Fix Selenium’s session not created error by checking Chrome and ChromeDriver compatibility, executable selection, permissions, and startup logs.
Start by checking that the ChromeDriver Selenium actually launches is compatible with the installed Chrome version. Then verify the driver path and executable permissions, inspect ChromeDriver’s startup log and configured capabilities, and retry creating a browser session before debugging the screenshot command. SessionNotCreatedException means WebDriver could not create a session; it does not, by itself, identify the cause or mean that screenshot capture failed.
This guide uses Python for the runnable Selenium examples. The same diagnostic sequence applies to other Selenium language bindings.
1. Read the failure before changing configuration
Record the complete exception and startup log along with the Selenium binding and version, Chrome version, ChromeDriver version, operating system, driver path, and whether the run is local, remote, or in a container. These details distinguish a version-selection problem from a browser startup or host configuration problem.
Look for clues in the exact message:
This version of ChromeDriver only supports Chrome version 113points directly to a browser and driver compatibility mismatch. The Selenium project documented this kind of error when Chrome updated while a pinned driver stayed old.Chrome failed to startindicates a startup failure but does not prove the cause. Check the ChromeDriver log, browser binary, profile and capabilities, and runtime restrictions.- If the exception occurs while constructing the driver, no working WebDriver session exists yet. A screenshot call made after session creation is a separate stage.
Selenium’s troubleshooting guide identifies incompatible browser and driver versions, inaccessible or non-executable driver binaries, and macOS privacy restrictions among possible causes. The WebDriver protocol also allows session creation to fail when the browser does not start or capabilities do not match. See Selenium’s error troubleshooting guide and the WebDriver documentation.
2. Check Chrome and ChromeDriver compatibility
- Find the version of the Chrome executable used by this run. Check the same machine, container, or remote browser environment that runs Selenium.
- Find the ChromeDriver version Selenium selected. A driver explicitly supplied in code or configuration, or one found on
PATH, may be selected instead of Selenium Manager’s fallback. - Resolve a mismatch by selecting a compatible driver, or by pinning a compatible browser and driver pair for the environment. Do not assume the Chrome installed on your workstation is the one used in CI.
- Repeat session creation and confirm it succeeds before testing screenshots.
For example, a ChromeDriver 113 error naming support for Chrome version 113 while the browser is version 115 is evidence of a mismatch. Update or deliberately pin the pair; adding screenshot options will not repair an incompatible pair.
Choose how to manage the driver
| Approach | When it fits | What to check |
|---|---|---|
| Selenium Manager fallback | You want Selenium to manage driver resolution and no explicit driver is supplied. | Use a Selenium release whose manager behavior fits your environment. Check logs for an incompatible driver already present on PATH. Selenium Manager shipped with Selenium releases starting at 4.6; exact behavior has evolved, so consult current documentation. |
| Manually pinned ChromeDriver | Your build intentionally controls the browser and driver versions. | Update the driver when the browser changes. Verify the configured executable and PATH so an old copy does not win selection. |
| Pinned Chrome for Testing and driver | You want a controlled, non-evergreen testing pair. | Pin and provision both versions together. Confirm current setup and availability in the official Chrome for Testing and Selenium documentation before adopting a specific version. |
The Selenium project’s Selenium 4.11.0 release article describes Selenium Manager behavior and Chrome for Testing support at that release. Treat those details as release-specific, not a guarantee that every current setup resolves drivers identically.
3. Verify which ChromeDriver Selenium launches
If versions appear compatible, inspect how the executable is selected. Check your code for an explicit driver service path, project configuration, environment or system properties, and any driver installed on PATH. A stale manually supplied binary can prevent the intended manager fallback from being used.
For a Python project using Selenium Manager, a minimal local reproduction is:
from selenium import webdriver
# Do not provide a Service executable_path here when checking
# Selenium Manager's fallback behavior.
driver = webdriver.Chrome()
try:
driver.get("https://example.com")
print(driver.title)
finally:
driver.quit()
Install the Selenium package in the same Python environment that runs the script. If this fails, preserve the full traceback and driver logs. If your application supplies a driver path elsewhere, remove or correct that configuration for the reproduction rather than assuming this snippet controls it.
4. Check driver access and operating-system restrictions
- Confirm the configured driver file exists and is readable and executable by the process running Selenium.
- On Linux or macOS, if the driver exists but lacks execute permission, Selenium’s troubleshooting guidance gives
chmod +x /path/to/driveras a possible correction. - On macOS, check whether Privacy & Security blocked the driver and review the system’s action for that binary.
- In CI or a container, check that the browser and driver are installed in the environment where the job actually runs and that the process can access them.
Make permissions or platform changes only when the evidence points there. A startup message by itself does not show that a generic container flag or other launch option is needed.
5. Inspect browser startup and capabilities
If versions, executable selection, and permissions check out, inspect the ChromeDriver startup log and the options passed to Chrome. Confirm the configured browser binary exists, the selected profile can be used, and the requested capabilities are supported by the active browser and driver. Compare a minimal session with the application’s configured session to find which setting introduces the failure.
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
# Use this form only when you intentionally manage the driver binary.
service = Service(executable_path="/path/to/chromedriver")
driver = webdriver.Chrome(service=service)
try:
driver.get("https://example.com")
driver.save_screenshot("page.png")
finally:
driver.quit()
Replace the path with the driver you intend to run. This example is not a version resolver: confirm that this binary is compatible with the Chrome binary used by the process. If you want Selenium Manager to resolve the driver, omit the explicit service path.
6. Test screenshot capture only after session startup works
Once driver construction succeeds, navigate to a page and issue a screenshot command. If the session starts but the capture command fails, debug the active session, browser window, and screenshot operation as a separate issue. WebDriver lists unable to capture screen separately from session not created; one should not be diagnosed as the other. See MDN’s WebDriver error reference.
from selenium import webdriver
# First verify startup, then verify the screenshot command.
driver = webdriver.Chrome()
try:
driver.get("https://example.com")
saved = driver.save_screenshot("page.png")
print(f"Screenshot saved: {saved}")
finally:
driver.quit()
7. Troubleshooting by symptom
| Symptom | Likely area to investigate | Next step |
|---|---|---|
| Error names a ChromeDriver-supported Chrome major version that differs from installed Chrome. | Version mismatch or wrong driver selected. | Align the browser and driver versions; inspect explicit paths and PATH. |
Chrome failed to start without a version clue. |
Browser startup, capabilities, profile, binary path, or host restrictions. | Read the full ChromeDriver log and retry with minimal configuration. |
| Driver file is missing or cannot execute. | Incorrect path or filesystem permissions. | Verify the file in the runtime environment and grant the required executable permission. |
| Selenium Manager is expected, but an old driver is used. | An explicit driver configuration or stale driver on PATH. |
Identify the selected executable from configuration and logs; remove or correct the stale selection. |
| Session starts, then screenshot command fails. | Screenshot capture stage, not session creation. | Keep the session alive, navigate successfully, and investigate the capture error and active window. |
8. Keep screenshot jobs reliable and predictable
- Pin deliberately in CI: If reproducibility matters, provision a known browser and compatible driver together. If you rely on Selenium Manager, keep its Selenium version and runtime environment controlled and inspect resolution logs when the environment changes.
- Separate startup from capture: Log session creation, navigation, and screenshot capture as distinct steps. This makes a driver startup regression distinguishable from a page or capture failure.
- Always close sessions: Put
driver.quit()in afinallyblock so exceptions do not leave browser processes behind. - Avoid unverified flags: Add browser launch arguments only when logs and the target runtime support that diagnosis. Flags can mask a local symptom while making another environment behave differently.
- Budget for setup and page loading: Browser startup and page load consume time independently of screenshot encoding. Set job timeouts based on the environment and diagnose which stage is slow before increasing them.
Manual pinning gives control but requires coordinated updates. Manager-based resolution reduces manual driver selection when supported, while still depending on the Selenium release and runtime configuration. The supplied research provides no benchmark or universal cost figure for either approach.
Or skip the browser setup
If your goal is to capture a website rather than run a browser session in your own environment, ScreenshotNeo provides a website screenshot API and MCP server. The API returns an image or PDF from a GET request; see the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
const image = Buffer.from(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('shot.webp', image));
ScreenshotNeo removes cookie banners, popups, and chat widgets before the shot. Bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000. Sign up for free and get 1,000 screenshots a month with no card.
FAQ
Does this exception prove ChromeDriver is outdated?
No. A message that names a supported Chrome version is strong mismatch evidence. Other session creation messages can result from launch configuration, permissions, or host restrictions.
Should I debug save_screenshot() first?
No. If driver construction failed, there is no session to capture from. Get session creation working, then test the screenshot command.
Will Selenium Manager always override a driver on PATH?
Do not assume so. Explicit configuration and an existing driver can affect selection. Check the logs and current documentation for your Selenium release.
Which details should I include when asking for help?
Share the full exception, Selenium binding and version, Chrome and ChromeDriver versions, operating system, selected driver path, relevant capabilities, and whether the run is local, remote, or containerized.


