0

I am testing a web application using the c# bindings for selenium webdriver. The test clicks through some elements with onclick function like (onclick="window.location.href = 'google.com'"). When it comes to the last element, it clicks it and the next page which is a javascript image viewing application loads. Instead of the test finishing the page remains open in the same position for 60 seconds until it fails with the error:

--WebException at System.Net.HttpWebRequest.GetResponse() at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)

Result Message: OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:27431/session/fd102072-024b-4ccc-99af-4c8e609c027d/element/0843e2a6-82ce-48ff-9ad2-2649585a43dc/click timed out after 60 seconds. ----> System.Net.WebException : The request was aborted: The operation has timed out.

This same test works in both chrome and firefox. The element is definitely displayed and clicked. The browser also goes to the page properly, but times out for some reason.

Saifur
  • 16,081
  • 6
  • 49
  • 73

2 Answers2

0

This is not a new issue. It has been around for quite a long. I have been reading about this issue on stackoverflow and google group time to time. Even though the issue seems to be unique(because I have used webdriver .net binding for about two years and never ran into this issue) there is a solid explanation from the author of IEDriver server why this happens. A lot of people suggest increasing the implicit wait might help even though I suspect that would. Reading the blog may help you to understand the problem and pinpoint the issue.

Community
  • 1
  • 1
Saifur
  • 16,081
  • 6
  • 49
  • 73
0

What you need to do is...:

InternetExplorerDriverService driverService = InternetExplorerDriverService.CreateDefaultService();
                //driverService.HideCommandPromptWindow = true;
                driverService.LibraryExtractionPath = Environment.CurrentDirectory;

                InternetExplorerOptions options = new InternetExplorerOptions();
                options.EnableNativeEvents = true;
                options.IgnoreZoomLevel = true;
                options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;



                IWebDriver driver = new InternetExplorerDriver(driverService, options, TimeSpan.FromSeconds(180));
Leon Barkan
  • 2,676
  • 2
  • 19
  • 43