9

私は 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 バージョンではこの問題が解決されています。

4

1 に答える 1

11

Selenium v​​ 2.9.0を実行しているときに、Firefox 8にアップグレードした後、この問題が発生しました。

Selenium の最新バージョン(2.13)にアップグレードすることで修正されました。

 sudo pip install selenium --upgrade

(Python フレーバーを使用している場合)

于 2011-11-25T13:47:14.283 に答える