Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

"OpenQA.Selenium.WebDriverException: No response from server for url" goes unhandled in CommandTimer.cs #4248

Closed
lukeis opened this issue Mar 3, 2016 · 5 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 4248

Selenium version: 2.20.0, confirmed in trunk and observed in 2.24.0
OS: Windows 7
Browser: Firefox
Browser version: 11.0

I have been seeing the exception below when running with the Firefox driver when I
make calls to WaitForPageToLoad, select elements, or get the url of the page. The stack
trace points to CommandTimer.cs where a new thread is created, a SeleneseCommand is
executed in that thread and only SeleniumExceptions are properly handled. I am seeing
a WebDriverException thrown inside of RunCommand(), and because it is in its own thread
it bypasses my own exception handling and crashes my program. 




OpenQA.Selenium.WebDriverException: No response from server for url http://localhost:7055/hub/session/68c03bc2-dc3f-4b8e-aadd-9b6b35d8481f/execute
   at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\HttpCommandExecutor.cs:line
115
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\HttpCommandExecutor.cs:line
96
   at OpenQA.Selenium.Firefox.Internal.ExtensionConnection.Execute(Command commandToExecute)
in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Firefox\Internal\ExtensionConnection.cs:line
128
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(DriverCommand driverCommandToExecute,
Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
795
   at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScriptInternal(String script, Boolean
async, Object[] args) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
1022
   at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScript(String script, Object[]
args) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
402
   at Selenium.Internal.SeleniumEmulation.WaitForPageToLoad.HandleSeleneseCommand(IWebDriver
driver, String locator, String value) in c:\Projects\WebDriver\trunk\dotnet\src\Selenium.WebDriverBackedSelenium\Internal\SeleniumEmulation\WaitForPageToLoad.cs:line
35
   at Selenium.Internal.SeleniumEmulation.SeleneseCommand.Apply(IWebDriver driver,
String[] args) in c:\Projects\WebDriver\trunk\dotnet\src\Selenium.WebDriverBackedSelenium\Internal\SeleniumEmulation\SeleneseCommand.cs:line
27
   at Selenium.Internal.CommandTimer.RunCommand() in c:\Projects\WebDriver\trunk\dotnet\src\Selenium.WebDriverBackedSelenium\Internal\CommandTimer.cs:line
74
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Reported by Oldmantaggie on 2012-07-12 21:21:09

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by barancev on 2012-07-16 12:06:25

  • Labels added: Component-WebDriverBackedSelenium, Lang-CSharp, Browser-Firefox

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Issue 2765, 3719 e.g.
workaround - https://groups.google.com/d/msg/selenium-users/W7bYZIgOREA/tWzCCutVS8QJ

Reported by MixeR007 on 2012-08-13 06:46:49

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

This workaround addresses the specific exception that is thrown in my example, but it
does not work for any others. The real problem here is that functions, which can throw
any number of exceptions, are getting invoked in a new thread without proper exception
handling. Anything that uses the CommandTimer class is limited to throwing SeleniumExceptions
or it will crash the entire program. I have also seen this happen with System.TimeoutExceptions
and System.InvalidOperationExceptions see the stack traces below.


System.TimeoutException: The driver reported that the command timed out. There may
be several reasons for this. Check that the destination site is in IE's 'Trusted Sites'
(accessed from Tools->Internet Options in the 'Security' tab) If it is a trusted site,
then the request may have taken more than a minute to finish.
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
973
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,
Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
809
   at OpenQA.Selenium.Remote.RemoteWebDriver.set_Url(String value) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
146
   at Selenium.Internal.SeleniumEmulation.Open.HandleSeleneseCommand(IWebDriver driver,
String locator, String value) in c:\Projects\WebDriver\trunk\dotnet\src\Selenium.WebDriverBackedSelenium\Internal\SeleniumEmulation\Open.cs:line
35
   at Selenium.Internal.SeleniumEmulation.SeleneseCommand.Apply(IWebDriver driver,
String[] args) in c:\Projects\WebDriver\trunk\dotnet\src\Selenium.WebDriverBackedSelenium\Internal\SeleniumEmulation\SeleneseCommand.cs:line
27
   at Selenium.Internal.CommandTimer.RunCommand() in c:\Projects\WebDriver\trunk\dotnet\src\Selenium.WebDriverBackedSelenium\Internal\CommandTimer.cs:line
74
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()


System.InvalidOperationException: waiting for doc.body failed (UnexpectedJavaScriptError)
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
997
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,
Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
809
   at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScriptInternal(String script, Boolean
async, Object[] args) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
1031
   at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScript(String script, Object[]
args) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
406
   at Selenium.Internal.SeleniumEmulation.WaitForPageToLoad.HandleSeleneseCommand(IWebDriver
driver, String locator, String value) in c:\Projects\WebDriver\trunk\dotnet\src\Selenium.WebDriverBackedSelenium\Internal\SeleniumEmulation\WaitForPageToLoad.cs:line
35
   at Selenium.Internal.SeleniumEmulation.SeleneseCommand.Apply(IWebDriver driver,
String[] args) in c:\Projects\WebDriver\trunk\dotnet\src\Selenium.WebDriverBackedSelenium\Internal\SeleniumEmulation\SeleneseCommand.cs:line
27
   at Selenium.Internal.CommandTimer.RunCommand() in c:\Projects\WebDriver\trunk\dotnet\src\Selenium.WebDriverBackedSelenium\Internal\CommandTimer.cs:line
74
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()


Reported by Oldmantaggie on 2012-08-13 15:56:53

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

This issue was closed by revision ffd8a35080a1.

Reported by james.h.evans.jr on 2014-01-28 20:18:59

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 18:15:47

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 3, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.