2013-05-15 85 views
0

我一直在使用webdriver.Firefox()来测试我的测试用例,但是想在IE上测试。我下载了IEDriverServer,将它添加到我的PATH并成功运行IE测试用例。然而,当我然后试图切换回Firefox和运行相同的测试情况下,Firefox浏览器打开了,但什么都没有发生,然后我收到此错误:IEDriverServer安装后WebDriver 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和竟然将其删除。我重新启动Eclipse(我正在使用它来运行我的Python/WebDriver测试),并重新启动IE和Firefox无济于事。

任何帮助表示赞赏。

编辑

我使用Python 3.3来开发我的测试情况下,如果有差别。

+0

请将您的代码放在您的问题中,只需在您初始化驱动程序的位置即可。但是,如果没有这个,我们就无法做到。我也仔细检查任务管理器的进程列表中没有打开IEDriverServer或IE进程。 – Arran

回答

0

是否有您的文件中的一个_ _ pycache _ _目录? 我删除它。删除后无错误。

PS。 python 3.3.2

相关问题