我在 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
有人遇到过这个问题吗?如何解决这个问题?提前致谢。
EDIE :selenium 2.5 版本已经解决了这个问题。