当前位置: 首页 > 知识库问答 >
问题:

selenium与firefox问题--尽管有更新,firefox没有响应[重复]

云宜人
2023-03-14

当我尝试运行使用Selenium打开浏览器(Firefox)的功能测试时,我收到了一条奇怪的消息,我无法理解。我已经使用pip安装--升级Selenium更新了Selenium,并重新安装了最新的Firefox,但没有帮助。这是我的错误消息的全文。有什么建议吗?

EE
======================================================================
ERROR: test_can_login (__main__.NewVisitorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "functional_tests.py", line 12, in setUp
    self.browser = webdriver.Firefox()
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 85, in __init__
    keep_alive=True)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 90, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 177, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 234, in execute
    response = self.command_executor.execute(driver_command, params)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 401, in execute
    return self._request(command_info[0], url, body=data)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 432, in _request
    resp = self._conn.getresponse()
  File "C:\Python27\lib\httplib.py", line 1132, in getresponse
    response.begin()
  File "C:\Python27\lib\httplib.py", line 453, in begin
    version, status, reason = self._read_status()
  File "C:\Python27\lib\httplib.py", line 409, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "C:\Python27\lib\socket.py", line 480, in readline
    data = self._sock.recv(self._rbufsize)
error: [Errno 10054] An existing connection was forcibly closed by the remote host

======================================================================
ERROR: test_can_register (__main__.NewVisitorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "functional_tests.py", line 12, in setUp
    self.browser = webdriver.Firefox()
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 81, in __init__
    self.binary, timeout)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 51, in __init__
    self.binary.launch_browser(self.profile, timeout=timeout)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 68, in launch_browser
    self._wait_until_connectable(timeout=timeout)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 98, in _wait_until_connectable
    raise WebDriverException("The browser appears to have exited "
WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.


----------------------------------------------------------------------
Ran 2 tests in 14.789s

FAILED (errors=2)

共有1个答案

班承恩
2023-03-14

如果您使用的是FirefoxDRiver并且安装了Firefox 47,您应该考虑使用MarionetteDRiver,因为Mozilla正在切换到Marionette。

 类似资料:
  • 公共类性能测试{ } 驱动程序信息:driver.version: FirefoxDriver在org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)在org.openqa.selenium.firefox.FirefoxDriv

  • 我是一个python初学者,尝试使用selenium在Win 10和Anaconda 2.5上打开Firefox。我刚刚下载了Firefox并在Anaconda上安装了selenium,所以它们是最新的。当我键入以下内容时: Firefox在任务栏中打开一秒钟,然后消失。但是如果我关闭cmd线,火狐会在窗口上打开。cmd提示符上的光标在闪烁,所以当我等待时,我会收到错误消息。我该怎么解决这个问题?

  • 正在尝试调试flexbox跨浏览器问题。我有一个基本的圣杯布局,带有固定标题的可滚动内容和一个离开画布的左导航。 布局在Chrome 45.0中正确显示。2421.0 m(64位),但不在Firefox 38.05中 Firefox中的问题 1) 没有滚动条 2)页脚丢失或脱离页面 3) 在单击切换按钮之前,画布外的左侧导航不应可见 4) 两侧的列与内容列不齐,看起来稍高一些 附上布局代码

  • 当我试图运行从Selenium IDE导出到Eclipse(导出为JUnit4 Webdriver)的Selenium测试用例时,我收到以下错误: NotConnectedException:45000 ms后无法连接到端口7055上的主机127.0.0.1。Firefox控制台输出:无法读取application.inicould无法读取application.ini 我在Mac OS X 10

  • 我是硒自动化的新手。我以管理员身份在系统中安装了Selenium IDE和Selenium RC(java-jar Selenium.jar)。另外,我使用的是Eclipse SDK版本3.7.1。编译代码时出现以下错误(运行为->TestNG测试) Selenium RC版本为2.42.2,firefox版本为23.0 错误: ==================================

  • 对于ex,当我的chrome放在Compand提示符中时,会给出路径-/applications/google\chrome.app system.setproperty(“webdriver.chrome.driver”,“/applications/google/chrome.app”);WebDriver driver=new ChromeDriver(); driver.get(“http