0

I'm writing automation with Python (3.6.5) and Selenium (3.141.0). The webpage I'm visiting, opening a new tab, which I get to my driver.window_handles in Chrome and FF, but not in IE 11.

I tried to google. The only solution I could find is: How to switch to the new browser window, which opens after click on the button?

But it didn't work.

I tried to add 1 second of sleep but the result remained the same.

handles = self.browser.window_handles
test.log('window handles: ' + str(len(handles)))

I expected the output to be 2, which I get in Chrome and FF but in IE I get 1.

Yoav Keren
  • 99
  • 10
  • Have you tried adding a wait for `len(handles) > 1`? – JeffC May 23 '19 at 14:02
  • @JeffC yes, I also used WebDriverWait(driver, 20).until(EC.number_of_windows_to_be(2)) and nothing changed. – Yoav Keren May 23 '19 at 14:29
  • So the wait timed out or ? – JeffC May 23 '19 at 14:57
  • There're some required configurations to set when using IEDriver, you can follow the [required configurations](https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration) in this documentation and try it again. Also [this thread](https://stackoverflow.com/questions/33510283/unable-to-get-new-window-handle-with-selenium-webdriver-in-java-on-ie) and [this thread](https://stackoverflow.com/questions/19777318/new-window-handles-disappearing-in-ie/19794327#19794327) can be helpful. – Yu Zhou May 24 '19 at 05:47
  • @JeffC timed out, yes. – Yoav Keren May 26 '19 at 15:43
  • @YuZhou I will try this and update. Thanks! – Yoav Keren May 26 '19 at 15:44

0 Answers0