微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

引发了具有空响应的异常,该请求将HTTP请求发送到远程WebDriver服务器以获取URL http:// localhost:62120 / session // element 环境:异常:问题描述:要点:

如何解决引发了具有空响应的异常,该请求将HTTP请求发送到远程WebDriver服务器以获取URL http:// localhost:62120 / session // element 环境:异常:问题描述:要点:

环境:

  • .NET core 3.1
  • Nunit 3.12
  • Nunit3adapter 3.17
  • Selenium Webdriver 3.141
  • Chromedriver 84.0.4147.3001(最新的稳定版)
  • 对应的Chrome浏览器84.0.4147.135
  • DotNetSeleniumExtras.WaitHelpers 3.11

异常:

A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL **http://localhost:55162/session//url**. The status of the exception was UnkNownError,and the message was: No connection Could be made because the target machine actively refused it. No connection Could be made because the target machine actively refused it.: 
   at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.get_Url()
   at Swat.Extension.WebElementExtensions.<>c__displayClass19_0.<WaitUntilUrlIsChanged>b__0(IWebDriver x)
   at OpenQA.Selenium.Support.UI.DefaultWait`1.Until[TResult](Func`2 condition)

问题描述:

对于同一测试用例,在执行一个个体时会很正常,但是在按顺序执行多个案例时,它将在上一个测试完成并使用{{1 }}。

有人可以给我一些解决方案吗?

要点:

URL的WebDriver服务器似乎丢失了会话ID,即http:// localhost:62120 / session / SessionId / element,因此URL中有两个斜杠“ //”。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。