我使用python中的selenium webdriver自動驅動Firefox,python腳本是從Firefox中的selenium IDE插件中導出的。但是當我運行腳本時會引發錯誤:WebDriverException:無法在selenium python腳本中加載配置文件錯誤
======================================================================
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
有沒有人遇到過這個問題?如何解決這個問題?提前致謝。
EDIE:硒2.5版本已經解決了這個問題。
我們可以看到代碼? 我在C#中遇到過類似的問題,但不能在沒有看到代碼的情況下告訴你任何事情...... – Anders
+1 - 與硒2.9.0相同的問題。懷疑它可能與最近的Firefox 8升級有關。 – hwjp