getWindowHandles return one window handle if multiple tabs are open in single window getWindowHandles return one window handle if multiple tabs are open in single window selenium selenium

getWindowHandles return one window handle if multiple tabs are open in single window


This is working as intended according to the FirefoxDriver team. See their response at https://github.com/SeleniumHQ/selenium/issues/1614:

In the case of clicking on a link that opens a new window (via target=_blank or a similar mechanism, the driver will know about those windows or tabs. The case of attempting to control+click (or command+click) a link to open it in a new tab circumvents the driver's mechanism for creating new top-level browsing contexts. Thus, such new tabs or windows are not managed by the driver.