WebDriver switching to new window

String firstWindow = driver.getWindowHandle();

Set<String> allWindows = driver.getWindowHandles();

Iterator<String> windowsIterator = allWindows.iterator()

While(windowsIterator.hasNext()){

    String windowHandle = windowsIterator.next().toString();

    if(!windowHandle.equals(firstWindow)){

       driver.swithTo().window(windowHandle);

       break;

    }

}

上一篇:halcon第三讲 算子介绍


下一篇:Halco自标定