1

I have an application which leverages Selenium to drive an IE session (the target site is IE only). This all works fine.

With the retirement of IE, I have made the appropriate changes so that the application uses Edge in IE Compatibility Mode instead of IE. No other changes have been made other than adding in the following:

if (useEdgeInCompatabilityMode)
{
    ieOptions.EnableNativeEvents = true;
    ieOptions.AttachToEdgeChrome = true;
    ieOptions.EdgeExecutablePath = edgeExePath;
}

What I am finding is that I get a high frequency of the "The HTTP request to the remote WebDriver server timed out after 60 seconds" error when using Edge. It is not consistent, and sometimes the application runs fine without error.

The error itself seems to happen when a Click action is called on a button within a pop-up window. Clicking the button causes the pop-up to close, at which point the next step in the Selenium process should be called on the parent window. However, it seems the Click action is never "resolved" to the satisfaction of Selenium, hence the timeout. I have experimented with replacing the Click with a Submit and with calling a JS Executor to call the JS which resides behind the target button directly, but neither seems to help.

I am using the most up to date NuGet and IEDriverServer.exe (4.2.0 for both).

Any advice appreciated.

James
  • 1,979
  • 5
  • 24
  • 52
  • Have you seen https://stackoverflow.com/questions/22322596/selenium-error-the-http-request-to-the-remote-webdriver-timed-out-after-60-sec ? There are quite a few answers, though I don't know if any are specific to the Edge browser, so they may not apply. – Timothy G. Jun 23 '22 at 12:32
  • @Timothy G Yes, this is what inspired me to try the JS Execution approach against the button, rather than the Click action. Didn't seem to help much in my case. A lot of suggestions for using "no-sandbox" but this is not applicable in IE/Edge. – James Jun 23 '22 at 13:16
  • Normally you should add a short wait operation to ensure IEDriver has detected the new window. Please check out [this doc](https://learn.microsoft.com/en-us/microsoft-edge/webdriver-chromium/ie-mode?tabs=c-sharp#known-limitations) and see if it helps. – Yu Zhou Jun 24 '22 at 07:29
  • @YuZhou the problem I have is that its the initial Click action which times out. I have no control once that action is initiated until the Exception is caught. The Click does perform the expected action on the browser, but Selenium seems to not recognise this. I think that this is because the Click causes the pop-up to close and thus it doesn't get confirmation (probably due to the underlying issue you link to). But I have no means to step in here and "pause" during the click. – James Jun 24 '22 at 09:25
  • Have you met all the [Required Configuration](https://www.selenium.dev/documentation/ie_driver_server/#required-configuration) before automate IE mode? Which version of Selenium do you use and do you use the recommended 32 bit IEDriverServer? – Yu Zhou Jun 27 '22 at 09:03

0 Answers0