0

I know this question is duplicate with below question.

Driver.getWindowHandles() is always returning 1 in IE11 on Windows 10, although there are two windows open

Selenium - getWindowHandles() is returning value 1 irrespective of number of browser opened

But I research and try any solution but cannot resolve problem. I also try setting follow guideline https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration but it is not working.

This is my code for testing

WebDriver oldDriver = new InternetExplorerDriver(InternetExplorerDriverService.createDefaultService(), createIEOption(Server.OLD));
                WebDriver newDriver = new InternetExplorerDriver(InternetExplorerDriverService.createDefaultService(), createIEOption(Server.NEW));
                //waiting page load
                TimeUnit.SECONDS.sleep(5);
    

            while(true) {
//for test
                TimeUnit.SECONDS.sleep(1);
                System.out.println("OLD: " + oldDriver.getWindowHandles().size());
                System.out.println("NEW: " + newDriver.getWindowHandles().size());
            }

I open many tab but result getWindowHandles() always return 1.

1 Answer 1

0

The IE driver cannot connect to and control “manually” opened new tabs (i.e., those opened via Ctrl+t). There is no workaround. Do not attempt to use tabs with the IE driver.

Refer Selenium IE driver returns tab count as 1 while using getWindowHandles method on multiple tabs of same window

1
  • Thanks for posting the answer to this question. I suggest you try to mark your own answer to this question after 48 hrs when it is available to mark. It can help other community members in the future in similar kinds of issues. Thanks for your understanding. Commented Mar 29, 2021 at 5:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.