el tegs
el tegs

Reputation: 11

Unexpected Exception Selenium IE Webdriver

I use visual studio 2010 C# with IEDriverServer.exe Webdriver version 2.42 on windows 7 32 bit OS.

In short I find an element and click it, the action completes fine (the element is clicked and causes the popup, which is not a new window, to close) but code appears to wait a while, and then throws an error (WebDriverException) on the Click() line.

It is almost as though it's unaware it completed its task successfully.

try
{
   popup.FindElement(By.ClassName("inbox_mainclose")).Click();
}

catch (WebDriverException)
{
}

I have no idea how to debug this while nothing appears to go wrong outside of the error, which causes my application to exit.

I'd love to hear from anyone who has encountered and or overcome this issue.

edit for exception information.

OpenQA.Selenium.WebDriverException was unhandled Message=The HTTP request to the remote WebDriver server for URL http://localhost:51989/session/e151b5bd-e473-4625-912b-aa2ba5c9e8de/element/c63f25fb-4b36-4de8-8474-aec538b84808/click timed out after 60 seconds.

Source=WebDriver StackTrace: at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\HttpCommandExecutor.cs:line 150

at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\HttpCommandExecutor.cs:line 114

at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\DriverServiceCommandExecutor.cs:line 73

at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 852

at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 745

at OpenQA.Selenium.Remote.RemoteWebElement.Execute(String commandToExecute, Dictionary`2 parameters) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebElement.cs:line 810

at OpenQA.Selenium.Remote.RemoteWebElement.Click() in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebElement.cs:line 336

at site_test.Form1.myClick(IWebElement webel) in C:\Users\eltegs\Documents\Visual Studio 2010\Projects\site_test\site_test\Form1.cs:line 42

at site_test.Form1.<>c__DisplayClass1.b__0() in C:\Users\eltegs\Documents\Visual Studio 2010\Projects\site_test\site_test\Form1.cs:line 240 at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: System.Net.WebException Message=The operation has timed out Source=System StackTrace: at System.Net.HttpWebRequest.GetResponse() at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\HttpCommandExecutor.cs:line 142 InnerException:

Upvotes: 0

Views: 624

Answers (1)

el tegs
el tegs

Reputation: 11

After further research around the web, I discovered this to be a problem in other webdrivers too, including chrome and firefox, and has been around without being fixed for over 18 months.

My solution was to get a reference to the ("inbox_mainclose") child of popup element, pass it to another thread and perform the click on it there.

This causes the new thread to wait for a request timeout and my main thread to get on with its work.

I'm writing this as an answer as the problem is in the webdriver external library.

Upvotes: 1

Related Questions