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


I get the following error:

Traceback (most recent call last):
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\common\", line 74, in start
stdout=self.log_file, stderr=self.log_file)
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python36\lib\", line 707, in __init__
restore_signals, start_new_session)
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python36\lib\", line 992, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/ishaq/AppData/Local/Programs/Python/Python36/", line 9, in <module>
driver = webdriver.Chrome(executable_path=os.path.abspath("chromedriver"), chrome_options=chrome_options)
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\chrome\", line 62, in __init__
File "C:\Users\ishaq\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\common\", line 81, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see

And my script is:

import os 
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from import Options

chrome_options = Options()
chrome_options.binary_location =
driver = webdriver.Chrome(executable_path=os.path.abspath("chromedriver"),

magnifying_glass = driver.find_element_by_id("js-open-icon")
if magnifying_glass.is_displayed():
menu_button = driver.find_element_by_css_selector(".menu-trigger.local")

search_field = driver.find_element_by_id("site-search")
assert "Looking Back at Android Security in 2016" in driver.page_source




You can test if it actually is in the python PATH, if you open a cmd and type in chromedriver and hit Enter. If Starting ChromeDriver 2.15.322448 is appearing, the PATH is set appropriately and there is something else going wrong. Then try the following:

Download ChromeDriver

Then you have multiple options:

* Add it to your system path
* Put it in the same directory as your python script
* Specify the location directly via executable_path

driver = webdriver.Chrome(executable_path='C:/path/to/chromedriver.exe')



The following code has to be executed with the Python script.

1.In command line: pip install webdriver-manager
2.Python script: 
from selenium import webdriver

from import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())

If you want to unleash your potential in this competitive field, please visit the selenium course page for more information, where you can find the selenium tutorials and selenium frequently asked interview questions and answers as well.


This topic has been locked/unapproved. No replies allowed

Login to participate in this discussion.

Leave a reply

Before proceeding, please check your email for a verification link. If you did not receive the email, click here to request another.