all,
Recently, I set a new ubuntu server (version 14.04.3) for a screenshot solution with firefox and selenium. Though there are a lot discussions about this topic since firefox v47, but it seems all can not fix mine.
My python script is as below:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
caps = DesiredCapabilities.FIREFOX
caps["marionette"] = True
caps["binary"] = "/usr/bin/firefox"
browser = webdriver.Firefox(capabilities=caps)
browser.set_window_size(1200, 2400)
For my development server, I have firefox v47.0.1 and selenium 2.53.5, and the code works. But in my new system, at beginning, I have firefox 48 and selenium 2.53.6, I got the error:
browser = webdriver.Firefox(capabilities=caps)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 65, in __init__
self.service.start()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 71, in start
os.path.basename(self.path), self.start_error_message)
WebDriverException: Message: 'wires' executable needs to be in PATH.
I tried to add the firefox binary to the PATH:
export PATH=$PATH:/usr/bin/firefox
After this, I got new error:
browser = webdriver.Firefox(capabilities=caps)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 65, in __init__
self.service.start()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 64, in start
stdout=self.log_file, stderr=self.log_file)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 20] Not a directory
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x7fe3183edf50>> ignored
As a post here mentioned v48 should fix this problem, but it seems it is not. Then I downgrade firefox to v47.0.1, but still get the same errors. I checked the selenium code from v2.53.6 and v2.53.5, can not really identify the issue. And then I uninstall selenium to v2.53.5. But still get the same error. I think there maybe something wrong with my setting related to firefox with selenium, but can not further debug this.
Can anyone help? Thanks very much
Zhihong