Environment:
- .NET core 3.1
- Nunit 3.12
- Nunit3adapter 3.17
- Selenium Webdriver 3.141
- Chromedriver 84.0.4147.3001 (latest stable version)
- corresponding Chrome Browser 84.0.4147.135
- DotNetSeleniumExtras.WaitHelpers 3.11
Exception:
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)
Issue Description:
For the same test case, it will be quite normal while executing an individual, but while multiple cases executing in order, it will throw the above exception on using wait.Until() method after the previous test finished and driver.Dispose().
Can anyone give me some solutions?
Highlight remarks:
It seems that the WebDriver server for URL lost the session id, that is http://localhost:62120/session/SessionId/element, so there are two slashes “//” in the URL.