0

テスト ケースに webdriver.Firefox() を使用してきましたが、IE でテストしたいと考えていました。IEDriverServer をダウンロードして PATH に追加し、IE テスト ケースを正常に実行しました。しかし、その後 Firefox に戻って同じテスト ケースを実行しようとすると、Firefox ブラウザーが開きましたが、何も起こらず、次のエラーが表示されました。

C:\Python33\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py:85: 
ResourceWarning: unclosed <socket.socket object, fd=280, family=2, type=1, proto=0>
 while not utils.is_connectable(self.profile.port):
C:\Python33\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py:85: 
ResourceWarning: unclosed <socket.socket object, fd=532, family=2, type=1, proto=0>
 while not utils.is_connectable(self.profile.port):
E
======================================================================
ERROR: test_ytest (__main__.Ytest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\K\workspace\PythonTesting\src\RecipeTest.py", line 11, in setUp
 self.driver = webdriver.Firefox()
File "C:\Python33\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 61, in __init__
 self.binary, timeout),
File "C:\Python33\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 47, in __init__
 self.binary.launch_browser(self.profile)
File "C:\Python33\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 51, in launch_browser
 self._wait_until_connectable()
File "C:\Python33\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 95, in _wait_until_connectable
 self.profile.path, self._get_firefox_output()))
selenium.common.exceptions.WebDriverException: Message: "Can't load the profile.     Profile Dir: c:\\users\\k\\appdata\\local\\temp\\tmp0vf9hl Firefox output: b'*** LOG addons.xpi: startup\\r\\n*** LOG addons.xpi: Skipping unavailable install location app-system-local\\r\\n*** LOG addons.xpi: Skipping unavailable install location app-system-share\\r\\n*** WARN addons.xpi: Ignoring missing add-on in C:\\\\Program Files (x86)\\\\Wajam\\\\Firefox\\\\{5a95a9e0-59dd-4314-bd84-4d18ca83a0e2}.xpi\\r\\n*** LOG addons.xpi: checkForChanges\\r\\n*** LOG addons.xpi: No changes found\\r\\n'" 

----------------------------------------------------------------------
Ran 1 test in 35.208s

FAILED (errors=1)

IEDriverSetup への PATH を削除し、それまで削除しました。Eclipse を再起動し (Python/WebDriver テストを実行するために使用しています)、IE と Firefox を再起動しましたが、役に立ちませんでした。

どんな助けでも大歓迎です。

編集

私はPython 3.3を使ってテストケースを開発していますが、それが違いを生む場合です。

4

1 に答える 1

0

ファイルの中に __ pycache __ ディレクトリはありますか? 私はそれを削除しました。削除するとエラーは発生しません。

PS。パイソン3.3.2

于 2013-05-19T15:56:57.350 に答える