IE Mode Enabled in Edge

45 views
Skip to first unread message

Raja s

unread,
Apr 9, 2024, 1:00:30 AM4/9/24
to Selenium Users
Hi Everyone,

Im trying to enable the IE mode in Edge, facing timeout exception, can you someone help here

using below code Edge opend with IE mode but didnot sucessfully initiated the driver, because it is not moving next line after driver initialization. 

Code:
 public void IEModeInEdge()
 {
     var options = new InternetExplorerOptions
     {
         IgnoreZoomLevel = true,
         InitialBrowserUrl = "google.com"
     };
     var driver = new InternetExplorerDriver(options);
    driver.Manage().Window.Maximize();
 }

Error:

Message: 
OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:49921/session timed out after 60 seconds.
  ----> System.Threading.Tasks.TaskCanceledException : The request was canceled due to the configured HttpClient.Timeout of 60 seconds elapsing.
  ----> System.TimeoutException : The operation was canceled.
  ----> System.Threading.Tasks.TaskCanceledException : The operation was canceled.
  ----> System.IO.IOException : Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
  ----> System.Net.Sockets.SocketException : The I/O operation has been aborted because of either a thread exit or an application request.

  Stack Trace: 
HttpCommandExecutor.Execute(Command commandToExecute)
DriverServiceCommandExecutor.Execute(Command commandToExecute)
WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
WebDriver.StartSession(ICapabilities capabilities)
WebDriver.ctor(ICommandExecutor executor, ICapabilities capabilities)
InternetExplorerDriver.ctor(InternetExplorerDriverService service, InternetExplorerOptions options, TimeSpan commandTimeout)
InternetExplorerDriver.ctor(InternetExplorerDriverService service, InternetExplorerOptions options)
EdgeWithIEMode.IEModeInEdge() line 25
--TaskCanceledException
HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
<7 more frames...>
HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
--IOException
AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
Int32>.GetResult(Int16 token)
HttpConnection.InitialFillAsync(Boolean async)
HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
--SocketException

Refered document: 

Raja s

unread,
Apr 15, 2024, 4:46:44 AM4/15/24
to Selenium Users
problem resolved by adding the below line of code.

                IgnoreProcessMatch = true

Reply all
Reply to author
Forward
0 new messages