Ich versuche, Testfälle für meinen Webapp mit Selen, firefox und Python webdrivers während meiner Entwicklungsumgebung ist Setup auf Ubuntu 16.04 LTS zu schreiben, aber ich bin Ausnahme bekommen,Selen funktionieren nicht mit Firefox und Python WebDriver auf ububtu
WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
Hier ist mein Code-Block
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
driver.close()
Hier ist komplett Ausnahme-Stack:
Traceback (most recent call last):
File "LoginLogout.py", line 4, in <module>
driver = webdriver.Firefox()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 80, in __init__
self.binary, timeout)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__
self.binary.launch_browser(self.profile, timeout=timeout)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
self._wait_until_connectable(timeout=timeout)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 99, in _wait_until_connectable
"The browser appears to have exited "
selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
Ich habe folgende Umgebungskonfiguration
Mozilla Firefox: 47,0
Selen Version: 2.53.6
Python-Version: 2.7.12
OS: Linux 4.4.0-31-generische # 50-Ubuntu SMP x86_64
Können Sie Firefox normalerweise außerhalb des Webdrivers starten? Ist es mit dem Chrome- oder IE-Treiber passiert? – Leustad