OpenQA.Selenium.WebDriverException The HTTP request to the remote WebDriver server for URL *** timed out after 120 seconds.

585 views
Skip to first unread message

michael falconi

unread,
Apr 19, 2022, 11:13:46 PM4/19/22
to Selenium Users
Like the title states, I am having an issue with the webdriver. This error occurs in the middle of test runs, no cause is discernable from my end, as it occurs randomly and not on every run, and on a different page every time it occurs. I am running through a set of pages (> 80 < 90) and the test typically runs for more than 8 mins before this error occurs. Can anyone explain what the error actually means? Why does this occur? I tried changed my timeout setting in the constructor and all that did was make me have to wait me more before the error finally shows up. It did nothing to actually solve the issue. 

Am working in C# using NUnit and the test are all being run again live pages no local hosts are being testing. Will include log below

Logs
 TestAllPages
   Source: powerSupplyTests.cs line 122
   Duration: 8.9 min

  Message: 
OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:57907/session/631a585eb89db89b963afa4f1f959dda/url timed out after 120 seconds.
  ----> System.Threading.Tasks.TaskCanceledException : The request was canceled due to the configured HttpClient.Timeout of 120 seconds elapsing.
  ----> System.TimeoutException : The operation was canceled.
  ----> System.Threading.Tasks.TaskCanceledException : The operation was canceled.
  ----> System.IO.IOException : Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
  ----> System.Net.Sockets.SocketException : The I/O operation has been aborted because of either a thread exit or an application request.
TearDown : OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:57907/session/631a585eb89db89b963afa4f1f959dda/window timed out after 120 seconds.
  ----> System.Threading.Tasks.TaskCanceledException : The request was canceled due to the configured HttpClient.Timeout of 120 seconds elapsing.
  ----> System.TimeoutException : The operation was canceled.
  ----> System.Threading.Tasks.TaskCanceledException : The operation was canceled.
  ----> System.IO.IOException : Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
  ----> System.Net.Sockets.SocketException : The I/O operation has been aborted because of either a thread exit or an application request.

  Stack Trace: 
HttpCommandExecutor.Execute(Command commandToExecute)
DriverServiceCommandExecutor.Execute(Command commandToExecute)
WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
WebDriver.set_Url(String value)
Driver.GoTo(String url) line 35
ProductPage.GoToProduct(String baseUrl) line 48
PowerSupplyTests.TestOrderDetailTabSingleProduct(ProductPage productPage) line 232
PowerSupplyTests.<TestAllPages>b__11_2(String p) line 140
List`1.ForEach(Action`1 action)
PowerSupplyTests.TestAllPages() line 136
--TaskCanceledException
HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
HttpCommandExecutor.Execute(Command commandToExecute)
--TimeoutException
--TaskCanceledException
HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
--IOException
AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
--SocketException
--TearDown
HttpCommandExecutor.Execute(Command commandToExecute)
DriverServiceCommandExecutor.Execute(Command commandToExecute)
WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
WebDriver.Close()
Driver.End() line 31
PowerSupplyTests.End() line 247
--TaskCanceledException
HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
HttpCommandExecutor.Execute(Command commandToExecute)
--TimeoutException
--TaskCanceledException
HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
--IOException
AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
HttpConnection.FillAsync(Boolean async)
HttpConnection.ReadNextResponseHeaderLineAsync(Boolean async, Boolean foldedHeadersAllowed)
HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
--SocketException
Reply all
Reply to author
Forward
0 new messages