Selenium Java - Handling Windows, Frames, and Alerts
You want to switch to a newly opened window different from the original one. Given
String originalHandle = driver.getWindowHandle(); and Set<String> allHandles = driver.getWindowHandles();, which code correctly switches to the new window?