8

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?

6
  • What do you mean run remotely? Call/run test in a machine, but the test execute on remote machine or the call/run and execute test on the same remote machine? What's the result if you run test on local machine? What's the detail of particular element? Commented Feb 24, 2017 at 9:26
  • @starain-MSFT It's called in VSTS and is run on a remote build server. I never encounter this issue when run locally. I'm not sure what you mean by "What's the detail of particular element?", I've shown the HTML of the element in question here. Commented Feb 24, 2017 at 21:05
  • Regarding particular element, do you mean it works fine with other element? Is the build agent running as interactive mode? On the other hand, it works fine when run locally, what's the result if you run it on that build server manually? Commented Feb 27, 2017 at 1:58
  • @starain-MSFT It works fine with other elements and it also works fine if I run it on the build server manually. I'm not sure honestly how to set the build agent up to run as interactive mode. Commented Feb 28, 2017 at 15:17
  • Regarding interactive mode, type no and press enter for the step of asking whether configure agent as service when you configure build agent. (You can set up a new build agent on the same machine with interactive mode) Commented Mar 1, 2017 at 1:33

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I have full access to the machine. What would you recommend getting more info on?
Try adding a proxy in between, I'd use Fiddler to see the requests going out to your remote Selenium WebDriver and see what's the issue around them

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.