python - Firefox Build does not work with Selenium -
for research, did source code modifications in firefox , build myself. in order automate testing, opted use selenium unfortunately, newly built firefox seem not support selenium.
i did following:
from selenium import webdriver selenium.webdriver.firefox.firefox_binary import firefoxbinary binary = firefoxbinary("/path/to/firefox/binary") d = webdriver.firefox(firefox_binary=binary) d.get("http://www.google.de")
the firefox open , responsive (i can enter website in search bar). after while, python script crashes following error message:
traceback (most recent call last): file "firefox.py", line 7, in <module> d = webdriver.firefox(firefox_binary=binary) file "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__ self.binary, timeout), file "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__ self.binary.launch_browser(self.profile) file "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 66, in launch_browser self._wait_until_connectable() file "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 109, in _wait_until_connectable raise webdriverexception("can't load profile. profile " selenium.common.exceptions.webdriverexception: message: can't load profile. profile dir: %s if specified log_file in firefoxbinary constructor, check details.
i did google error message , solutions suggested, should update selenium since not support firefox version used. unfortunately, installed newest version of selenium (2.44.0) , used older version of firefox (version 33) rule out point.
i made sure code modifications not reason crash building clean, unmodified firefox. selenium doesn't work firefox either.
if don't specify firefox binary , let selenium use installed firefox, works fine. guess is, wrong firefox build, did mentioned in online documentation (e.g. ./mach build).
has idea, mistake might be? appreciated!
some setup information:
- firefox 33
- selenium 2.44.0
- python 3.4 (also tried 2.7, doesn't work either)
- firefox build ubuntu 14.04
ubuntu 14.04, firefox 36.0, selenium 2.44.0. same problem, solved by:
sudo pip install -u selenium
selenium 2.45.0 ok ff36.
update: selenium 2.53+ compatible ff45
you can older ff versions here
Comments
Post a Comment