WebDriverException:can';selenium python脚本中的加载配置文件错误
我正在使用python中的selenium webdriver自动驱动Firefox,python脚本是从Firefox中的selenium IDE插件导出的。但当我运行脚本时,它会引发错误:WebDriverException:can';selenium python脚本中的加载配置文件错误,python,unit-testing,selenium,webdriver,web-testing,Python,Unit Testing,Selenium,Webdriver,Web Testing,我正在使用python中的selenium webdriver自动驱动Firefox,python脚本是从Firefox中的selenium IDE插件导出的。但当我运行脚本时,它会引发错误: ====================================================================== ERROR: test_selenium (__main__.SeleniumTest) ---------------------
======================================================================
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版本解决了这个问题。我在升级到Firefox 8后,在运行selenium v 2.9.0时遇到了这个问题 通过升级到selenium(2.13)的最新版本,它得到了修复
(如果您使用的是Python风格)我们可以看到代码吗?我在C#中也遇到过类似的问题,但如果不看到您的代码,我就无法告诉您任何事情…+1-selenium 2.9.0也存在同样的问题。我怀疑这可能与最近的Firefox 8升级有关。我也有同样的问题,但是由于selenium 2.9+中的错误,我无法升级到Firefox 8。我将不得不降级到Firefox 7,我的问题是在夜间测试运行期间自动更新,并且在升级之前我有我的Firefox首选项设置提示。我也遇到了这个问题。自上次运行selenium(版本为v2.2)以来升级了FF。我已经将其升级到2.24版本,它将firefox作为默认配置文件执行&没有错误。
sudo pip install selenium --upgrade