Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
473 views
by Contributing Tester (53 points)

I have updated Firefox, after that I cannot run it in Python Selenium. I googled it and this is somethig about geckodriver. Any ideas how to fix it?

Here's error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/common/service.py", line 74, in start
    stdout=self.log_file, stderr=self.log_file)
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver'
 
During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
  File "/home/roman/PycharmProjects/test.py", line 3, in <module>
    driver = webdriver.Firefox()
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py", line 140, in __init__
    self.service.start()
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/common/service.py", line 81, 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 0x7f359b5ca4e0>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/common/service.py", line 173, in __del__
    self.stop()
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/common/service.py", line 145, in stop
    if self.process is None:
AttributeError: 'Service' object has no attribute 'process

1 Answer

1 like 0 dislike
by The go-to Tester (181 points)
selected by
 
Best answer

Its looking for geckodriver.

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

https://github.com/mozilla/geckodriver/releases

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


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...