How do I change focus to a new popup tab in Selenium?

后端 未结 7 1240
渐次进展
渐次进展 2020-12-29 06:38

I\'m using Selenium and Firefox.

I have a link on a page (say linkA) that opens a new page in a new tab. The new tab is displayed when linkA is clicked. I then w

相关标签:
7条回答
  • 2020-12-29 07:00
    Iterator<String> windowIterator = driver.getWindowHandles().iterator();while (windowIterator.hasNext()) {
    String windowHandle = windowIterator.next();
    driverwindow = driver.switchTo().window(windowHandle);
    if (_driverwindow.getTitle().equals("Title of the window to switch")) {
    }
    }
    
    0 讨论(0)
提交回复
热议问题