# selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

- **ID:** `python/pytest-selenium-webdriver-error`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Selenium cannot find the ChromeDriver executable. This occurs when ChromeDriver is not installed, not in PATH, or the version does not match the installed Chrome browser.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 4.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.service import Service

driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
   ```
2. **** (92% success)
   ```
   from selenium import webdriver

driver = webdriver.Chrome()  # Auto-downloads driver
   ```

## Dead Ends

- **** — This makes tests non-portable and breaks on other machines or CI environments with different paths. (80% fail)
- **** — This works locally but is not reproducible. The driver may be outdated or incompatible with the browser version. (70% fail)
