Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebDriverException thrown partway through Selenium test only when running remotely

I seem to have an issue with one of my sets of tests ONLY when running remotely and ONLY when trying to interact with a particular element. I am building and running this through VSTS.

The error:

OpenQA.Selenium.WebDriverException: A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL (URL redacted, is a localhost URL). The status of the exception was ReceiveFailure, and the message was: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

The HTML for the element I'm trying to enter a number into (we are using knockout):

<input type="number" min="0" max="999" data-bind="value: redacted).extend({ min: 0, required: { message: 'redacted' } }), disable: redacted" name="redacted" id="redacted" title="redacted" required="required" class="">

Don't mind the redacted. I wanted to leave all the properties there to show what properties are set for the element but the actual values are redacted.

This is the code I'm using to enter a value into the element:

IWebElement element = driver.FindElement(By.Id(elementID));
element.Clear(); 
element.SendKeys(value);

This is running with ChromeDriver. There are several other number fields that I'm successfully able to populate data into without issue.

Any ideas what could be going wrong here and how to fix it?

like image 857
tnw Avatar asked Feb 21 '17 21:02

tnw


1 Answers

That looks some sort of SSL or internal network issue on VSTS build server, which is probably tricky to get more info on, because you shouldn't have full access to that machine.

We also have Selenium tests on our Continuous Integration, but we use a local build server bound to VSTS, much more control over builds and processes.

like image 130
NotHere Avatar answered Oct 06 '22 19:10

NotHere