Reputation: 3788
I have a collection of xunit tests using Selenium that all run fine for Chrome and Internet Explorer. Recently added is the need to test with Edge. After installing Selenium.WebDriver.MicrosoftDriver 17.17134.0, I encounter this error message:
A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://localhost:{FOO}/session. The status of the exception was UnknownError, and the message was: An error occurred while sending the request. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
Note: the port, represented above by {FOO} changes on each run, and not to any port configured anywhere in
launchSettings.json
files nor anywhere else in this solution.
The error occurs when running tests, on the following line:
IWebDriver result = new EdgeDriver();
Upvotes: 0
Views: 332
Reputation: 12946
Which version of Edge browser are you using? This error occurs mainly because the Microsoft WebDriver version you're using doesn't match the Edge version you're using.
If you're using Edge Legacy version prior to 18 or New Edge Chromium, you can download the appropriate webdriver for your installed version of Microsoft Edge in this link. If your Edge Legacy version is 18 or higher, you can install the appropriate webdriver version according to the ways in this article.
You could also refer to this thread for the similar issue.
Upvotes: 1