Do you have questions ? We got the answers!

Ask a question:

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

Open 2 Answers 4519 Views

I am getting below error with my selenium script.

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary('C:\Program Files (x86)\Mozilla Firefox\firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary)
assert "" in driver.title
elem = driver.find_element_by_css_selector(" > a:nth-child(1)")
assert "Nothing Found" in driver.page_source




Traceback (most recent call last):
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\selenium\webdriver\common\", line 64, in start
    stdout=self.log_file, stderr=self.log_file)
  File "C:\Program Files (x86)\Python35-32\lib\", line 947, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files (x86)\Python35-32\lib\", line 1224, 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 "", line 6, in <module>
    driver = webdriver.Firefox(firefox_binary=binary)
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\selenium\webdriver\firefox\", line 135, in __init__
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\selenium\webdriver\common\", line 71, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x00A0EBD0>>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\selenium\webdriver\common\", line 163, in __del__
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\selenium\webdriver\common\", line 135, in stop
    if self.process is None:
AttributeError: 'Service' object has no attribute 'process'

2 Answers


Its looking for geckodriver.

Download geckodriver from below location and add it to your PATH veriable.

Exit existing command line and reopen the same. This should help you.

answered Oct 24, 2016 by stbadmin (4,970 points)
answered Sep 6 by ChatBot (196 points)

Top Contributors

  • 4970 pointsstbadmin

    34 questions 454 answers218 comments

  • 433 pointsSunilBhaskar

    41 questions 15 answers32 comments

  • 425 pointsMehedi

    36 questions 3 answers14 comments

  • 363 pointssumitkumarwatts

    0 questions 13 answers0 comments

  • 354 pointsSoft Tester

    43 questions 0 answers4 comments

  • 327 pointsKeeshaGolden

    0 questions 17 answers2 comments

  • 322 pointsVipul Sharma

    44 questions 0 answers24 comments

  • 310 pointsvysh.sharma

    25 questions 0 answers0 comments

  • 267 pointsOnkar_Nimje

    33 questions 15 answers15 comments

  • 258 pointsVanitha

    26 questions 0 answers6 comments