[英]WebDriverException:can't load profile error in selenium python script
I am using selenium webdriver in python to drive Firefox automaticly, the python script is exported from the selenium IDE add-on in Firefox. 我在python中使用selenium webdriver自动驱动Firefox,python脚本从Firefox中的selenium IDE插件导出。 But when I run the script it raise error:
但是当我运行脚本时会引发错误:
======================================================================
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: Can't load the profile. WebDriverException:无法加载配置文件。 Profile Dir : c:\\users\\ataosky\\appdata\\local\\temp\\tmpwpz
个人资料目录:c:\\ users \\ ataosky \\ appdata \\ local \\ temp \\ tmpwpz
Have anybody encountered this problem? 有人遇到过这个问题吗? How to solve this?
怎么解决这个? Thanks in advance.
提前致谢。
EDIE :selenium 2.5 version has solve this problem. EDIE :selenium 2.5版本已经解决了这个问题。
I had this issue after upgrading to Firefox 8, when running selenium v 2.9.0. 升级到Firefox 8后运行selenium v 2.9.0时出现此问题。
It was fixed by upgrading to the latest version of selenium (2.13). 通过升级到最新版本的selenium (2.13)来解决这个问题。
sudo pip install selenium --upgrade
(if you're using the Python flavour) (如果您使用的是Python风格)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.