WebDriverException: ne peut pas charger erreur de profil dans le script python sélénium
-
27-10-2019 - |
Question
J'utilise WebDriver de sélénium en python pour conduire Firefox automaticly, le script python est exportée à partir de l'IDE de sélénium add-on dans Firefox. Mais quand je lance le script, il soulève erreur:
======================================================================
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: Impossible de charger le profil. Profil Dir: c: \ users \ ataosky \ AppData \ Local \ Temp \ tmpwpz
Quelqu'un at-il rencontré ce problème? Comment résoudre ce problème? Merci à l'avance.
EDIE :. Sélénium version 2.5 a résoudre ce problème
La solution
J'ai eu ce problème après la mise à niveau de Firefox 8, lors de l'exécution du sélénium v ??2.9.0.
Il a été fixé par mise à niveau vers la dernière version de sélénium (2.13).
sudo pip install selenium --upgrade
(si vous utilisez la saveur Python)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow