ChromeDriver "not found in PATH" / executable needs to be in PATH in CI
A Selenium client that manages its own driver could not find chromedriver on PATH. Either the driver was never installed on the runner, or it is installed to a directory that is not on PATH for the test step.
What this error means
The session fails to start with "'chromedriver' executable needs to be in PATH" (older Selenium) or "Unable to obtain driver for chrome" when the binary is missing.
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable
needs to be in PATH. Please see https://chromedriver.chromium.org/homeCommon causes
The driver is not installed on the runner
No setup step downloaded chromedriver, so there is no executable for Selenium to launch.
The driver is installed off PATH
The binary exists in a project or cache directory that the test step's PATH does not include.
How to fix it
Upgrade to Selenium Manager or install the driver
Selenium 4.6+ resolves and downloads the driver automatically; otherwise install it and put it on PATH.
- uses: nanasess/setup-chromedriver@v2
- run: python -m pytest tests/ # chromedriver now on PATHPoint the client at the driver explicitly
If the driver is in a known directory, pass its path via a Service so PATH is irrelevant.
from selenium.webdriver.chrome.service import Service
driver = webdriver.Chrome(service=Service('/usr/local/bin/chromedriver'))How to prevent it
- Prefer Selenium 4.6+ so the driver is resolved without PATH juggling.
- If installing manually, place the driver in a directory already on PATH.
- Verify with
which chromedriverin a debug step when unsure.