WebDriverException:Selenium Pythonスクリプトにプロファイルエラーを読み込むことができません
-
27-10-2019 - |
質問
PythonのSelenium WebDriverを使用してFirefoxを自動的に駆動しています。Pythonスクリプトは、FirefoxのSelenium IDEアドオンからエクスポートされています。しかし、スクリプトを実行すると、エラーが発生します。
======================================================================
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:プロファイルをロードできません。プロフィール監督:c: users ataosky appdata local temp tmpwpz
誰かがこの問題に遭遇しましたか?これを解決する方法は?前もって感謝します。
エディ:Selenium 2.5バージョンはこの問題を解決しています。
解決
Selenium V 2.9.0を実行しているときに、Firefox 8にアップグレードした後、この問題が発生しました。
それによって固定されました Seleniumの最新バージョンへのアップグレード (2.13).
sudo pip install selenium --upgrade
(Pythonフレーバーを使用している場合)
所属していません StackOverflow