5

I am using the latest Selenium WebDriver running using .NET/Microsoft Technology stack.

What I am observing these days is that all of my tests in the suite starts failing throwing this exception

Additional information: A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://localhost:5557/wd/hub/session/c775e68e-c842-41b3-a1a6-44a88ef4c210/element. The status of the exception was KeepAliveFailure, and the message was: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.

I am not able to figure out what is the issue and what I need to do to resolve this issue. I am quite sure this is not to do with the coding.

The issue mainly occurs when I try clicking on a button or trying to enter some text in the input box.

Could any one please point me in the right direction as what I need to resolve this issue

Thanks

Timothy Rajan
  • 1,947
  • 8
  • 38
  • 62
  • where you able to fix this? – ACB Jul 19 '18 at 12:46
  • 2
    I played around with the timeouts which resolved the issue. Due to larger timeout value, the connection between the hub and the client is getting lost. Thats the root cause of this issue... – Timothy Rajan Jul 21 '18 at 20:08

1 Answers1

2

This is old but thought I'd throw an answer here for anybody stumbling upon the same issue. Ran into this earlier today. I was able to get it to work by reducing the polling interval of the wait:

WebDriverWait myWait = new WebDriverWait(driver, TimeSpan.FromMinutes(5));
myWait.PollingInterval = TimeSpan.FromMilliseconds(500); //I reduced this from checking every 5 second to checking every half second and it started working.
bool waitOnUser = myWait.Until(t =>
            { ...});
chris-crush-code
  • 1,114
  • 2
  • 8
  • 17