WebDriverException:无法在selenium python脚本中加载配置文件错误

Tre*_*per 9 python selenium unit-testing webdriver web-testing

我在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)
Run Code Online (Sandbox Code Playgroud)

WebDriverException:无法加载配置文件.个人资料目录:c:\ users\ataosky\appdata\local\temp\tmpwpz

有人遇到过这个问题吗?怎么解决这个?提前致谢.

EDIE:selenium 2.5版本已经解决了这个问题.

hwj*_*wjp 11

升级到Firefox 8后运行selenium v​​ 2.9.0时出现此问题.

通过升级到最新版本的selenium(2.13)来解决这个问题.

 sudo pip install selenium --upgrade
Run Code Online (Sandbox Code Playgroud)

(如果您使用的是Python风格)