question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Switched to IE11 window times out [switchTo().window(handle)]

See original GitHub issue

Meta -

OS: Windows 7 Selenium Version: 2.53 Browser: IE Browser Version: 11

Expected Behavior -

I am using C# code to change IE11 browser’s tab switch. so far i can open a new tab successfully, but when i switch the tab using the following command, my code gets stuck : browser.driver.switchTo().window(windowHandles.oldTab)

Is it a Selenium Bug, or is this the wrong syntax to Switch Window Handle?

when i debug the issue, i get the following exception after waiting a long time :

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://127.0.0.1:4444/wd/hub/session/36fa4074-3b34-4dea-9da8-c8278b135c4f/window timed out after 240 seconds.

The issue is described in detail here, Please take a look at last 2 comment in this thread : https://github.com/angular/protractor/issues/55

Actual Behavior -

The driver object should Switch WindowsHandle. instead it stops at code line browser.driver.switchTo().window(windowHandles.newTab);

Steps to reproduce -

The code example is also written in the link.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
sophiaatifcommented, Jan 4, 2017

Hey guys im so sorry for not replying and the main reason is that i left that job and I couldn’t recall the solution, but I can vaguely recall that the issue was in logic, perhaps I was trying to access the new page before it got created or something like that, though now that i see the code here it doesnt look like that but the issue was only in logic and I corrected the order of calls. I hope it helps?

0reactions
bbealecommented, Jan 4, 2017

Hey @sophiaatif, I would be interested in seeing your workaround as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Selenium Script halts while switching window handles
Im using selenium webdriver 2.48.2, on win7 IE 11. The situation goes like this, I have a test that clicks on a button...
Read more >
New window handles disappearing in IE, can't work with new window
Loop over all handles and switch to new child window. foreach (string handle in allWindowHandles). {. if (handle != parentHandle). {. driver.SwitchTo().
Read more >
New opened window using selenium doesn't appear in the ...
Can try this: Before you switch to a newly open tab, try to wait for a while, e.g. WebDriverWait(browser, 5).until(EC.number_of_windows_to_be(2)).
Read more >
Top 10 Selenium Exceptions and How To Handle These ...
openqa.selenium.NoSuchWindowException if the window handle doesn't exist or is not available to switch. driver.switchTo().window(handle_1);.
Read more >
1297 - Timed out error exception while switching windows
if(!driver.switchTo().window(handle).getTitle().equals("<MY APPLICATION WINDOW NAME>")){ driver.close(); } } getTitle() is not evaluated for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found