简体   繁体   English

IEDriverServer设置后,WebDriver Firefox配置文件不起作用

[英]WebDriver Firefox profile not working after IEDriverServer setup

I've been using webdriver.Firefox() for my test cases, but wanted to test on IE. 我一直在使用webdriver.Firefox()做测试用例,但想在IE上进行测试。 I downloaded IEDriverServer, added it to my PATH and ran the IE test case successfully. 我下载了IEDriverServer,将其添加到PATH中并成功运行IE测试用例。 However, when I then tried switching back to Firefox and running the same test case, the Firefox browser opened up, but nothing happened, and then I received this error: 但是,当我然后尝试切换回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)

I've removed the PATH to IEDriverSetup and went so far as to remove it. 我已经删除了IEDriverSetup的PATH,甚至删除了它。 I restarted Eclipse (I'm using it to run my Python/WebDriver tests) and restarted IE and Firefox to no avail. 我重新启动了Eclipse(正在使用它运行我的Python / WebDriver测试),然后重新启动了IE和Firefox,但无济于事。

Any help is appreciated. 任何帮助表示赞赏。

EDIT 编辑

I am using Python 3.3 to develop my test cases, if that makes a difference. 我正在使用Python 3.3来开发我的测试用例,如果有帮助的话。

Is there a __ pycache __ directory among your files? 文件中是否有__ pycache __目录? I removed it. 我删除了 No error once it is removed. 删除后没有错误。

PS. PS。 python 3.3.2 python 3.3.2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将firefox配置文件传递给远程webdriver firefox实例无法正常工作 - Passing a firefox profile to remote webdriver firefox instance not working 如果 firefoxbinary 设置为 webdriver.Firefox(firefox_profile=profile, firefox_binary=binary),则 firefoxprofile 不起作用 - firefoxprofile not working if firefoxbinary is set as webdriver.Firefox(firefox_profile=profile, firefox_binary=binary) 创建Webdriver后Selenium Firefox配置文件更新下载目录 - Selenium firefox profile update download directory after creating webdriver Selenium Firefox Profile无法正常工作 - Selenium Firefox Profile not working 使用 Selenium 和 Python 定义 webdriver 后如何更改 firefox 配置文件首选项 - How to change firefox profile preference after defining webdriver using Selenium and Python Selenium Firefox Webdriver不采用配置文件 - Selenium Firefox webdriver does not adopt profile 在python中使用默认的firefox配置文件和selenium webdriver - Using the default firefox profile with selenium webdriver in python Selenium Webdriver无法在Firefox中使用Firefox - Selenium webdriver not working in python with firefox 如何在 selenium 中正确设置 firefox 配置文件? - How to setup firefox profile in selenium correctly? Selenium firefox 配置文件不再工作 - Selenium firefox profile not working anymore
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM