0

I developed an automatic test tool with python 2.7 and using selenium 3.0.1.It works fine on Firefox 49. I need that it works also with Firefox 45. I tried it but the tool finds problem to open the browser. The piece of script is like the following:

from selenium import webdriver

downloadPath="path/downloads"
profile = webdriver.FirefoxProfile() 
profile.set_preference('browser.download.manager.showWhenStarting', False)
profile.set_preference('browser.download.dir', downloadPath)
profile.set_preference('browser.helperApps.alwaysAsk.force', False)
profile.set_preference('browser.helperApps.neverAsk.openFile', 'application/x-targz, application/x-gzip, application/force-download')
profile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'application/x-targz, application/x-gzip, application/force-download')
browser =  webdriver.Firefox(profile)

This small program is fine working on Firefox 49, but in Firefox 45 I get this error:

Traceback (most recent call last):
  File "path/test.py", line 10, in <module>
    browser =  webdriver.Firefox(profile)
  File "/usr/local/lib/python2.7/dist-packages/selenium-3.0.1-py2.7.egg/selenium/webdriver/firefox/webdriver.py", line 135, in __init__
    self.service.start()
  File "/usr/local/lib/python2.7/dist-packages/selenium-3.0.1-py2.7.egg/selenium/webdriver/common/service.py", 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. 

I made searches in the internet and I found that I have to install geckodriver. I downloaded geckodriver from github: https://github.com/mozilla/geckodriver/releases I extracted the tar.gz file and I added its path to PATH environment variable like that:

export PATH=$PATH:/home/user/Downloads/geckodriver

But I got the same error. Does someone has an idea how I can fix this bug?

Kallel Omar
  • 1,208
  • 2
  • 17
  • 51

0 Answers0