WebDriveRexception: Profilfehler im Selenium -Python -Skript kann nicht geladen werden
-
27-10-2019 - |
Frage
Ich verwende Selenium Webdriver in Python, um Firefox automatisch zu treiben. Das Python-Skript wird aus dem Selen-IDE-Add-On in Firefox exportiert. Aber wenn ich das Skript ausführe, erhöht es einen Fehler:
======================================================================
ERROR: test_selenium (__main__.SeleniumTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "selenium_test.py", line 8, in setUp
self.driver = webdriver.Firefox()
File "C:\Python26\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 46, in __init__
self.binary, timeout),
File "C:\Python26\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 46,
in __init__
self.binary.launch_browser(self.profile)
File "C:\Python26\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 44, in lau
nch_browser
self._wait_until_connectable()
File "C:\Python26\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 87, in _wa
it_until_connectable
raise WebDriverException("Can't load the profile. Profile Dir : %s" % self.profile.path)
WebDriverException: Can't load the profile. Profile Dir : c:\users\ataosky\appdata\local\temp\tmpwpz
zrv
----------------------------------------------------------------------
Ran 1 test in 67.876s
FAILED (errors=1)
WebDriveRexception: Das Profil kann nicht geladen werden. Profil DIR: C: Benutzer Ataosky AppData Local temp tmpwpz
Ist jemand auf dieses Problem gestoßen? Wie löst ich das? Danke im Voraus.
Edie: Selenium 2.5 Version hat dieses Problem gelöst.
Lösung
Ich hatte dieses Problem nach dem Upgrade auf Firefox 8, als ich Selen v 2.9.0 ausführte.
Es wurde durch fixiert von Upgrade auf die neueste Version von Selenium (2.13).
sudo pip install selenium --upgrade
(Wenn Sie das Python -Geschmack verwenden)
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow