0

I have a wrapper that handles elements being clicked in the browser (it incorporates WebDriverWait). The final step is element.Click(). This code is used successfully on multiple elements during the test, however, when an tag is clicked that transitions to another page, the IE driver throws this exception:

An exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll but was not handled in user code

Additional information: The HTTP request to the remote WebDriver server for URL http://localhost:52368/session/fa3cb036-bbff-45b7-b914-03ed03c86d9c/element/bc89665f-94c3-4829-beee-cff4a106cf87/click timed out after 60 seconds.

The weird thing is that the click completed successfully, and the page transition occurred, but the driver seems to be looking for something else within that click function. The inner exception is:

{"The request was aborted: The operation has timed out."}

and its stack trace is:

at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo) at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebElement.Click()

I followed the steps to setup IE 11 here, and downloaded the version 3.8 of the driver from here (was able to reproduce on the 32-bit version of 3.9).

What

Kolichikov
  • 2,944
  • 31
  • 46
  • Does the page it is navigating to have iframes? – Ryan Wilson Feb 21 '18 at 17:41
  • Maybe it could help: https://stackoverflow.com/questions/22322596/selenium-error-the-http-request-to-the-remote-webdriver-timed-out-after-60-sec. – mtheriault Feb 21 '18 at 17:44
  • @RyanWilson It does have iframes, but just to be clear I'm not clicking on the iframes. – Kolichikov Feb 21 '18 at 17:49
  • @mtheriault. I've seen that post, and unfortunately I wasn't able to adapt any of the answers to IE and have it work successfully. My problem is a bit different because the browser isn't frozen and the expected click SUCCEEDS, but Selenium doesn't seem to believe that this is the case. – Kolichikov Feb 21 '18 at 17:49
  • 1
    @Kolichikov It may be that the built in Selenium WebDriverWait fails to recognize the frame loading or it is waiting for the frames to fully load to evaluate to true. If I were you, in this case, I would just cause a click on the link with javascript injector and then wait until the next element you need to manipulate or evaluate on the new page exists. – Ryan Wilson Feb 21 '18 at 17:55
  • @RyanWilson I was able to get to work with just the usual JavascriptExecutor, so I guess that's a way around it. But it's not ideal because our tests run through TestFixtureSources, and this means that IE needs its own workflow to get around clicking on pages with iframes. – Kolichikov Feb 21 '18 at 19:48

1 Answers1

0

i resolve this problem using Selenium.Interactions, for example if you want click on element:

var seleniumdriver = new InternetExplorerDriver();
Selenium.Intercactions.Action action = new Action(seleniumdriver);

action.MoveToElement(seleniumdriver.FindElement("your element")).Click().Perfom();

Sometimes if it does not focus on the current object this solution don't work. For major information you can visit: https://seleniumhq.github.io/selenium/docs/api/dotnet/html/T_OpenQA_Selenium_Interactions_Actions.htm

Inze
  • 1
  • 4