String currentHandle = driver.getWindowHandle();
Set<String> handles = driver.getWindowHandles();
handles.remove(currentHandle);
if (handles.size() > 0)
driver.switchTo().window(handles.iterator().next());
System.out.println(driver.getTitle());
driver.close();
driver.switchTo().window(currentHandle);
waitForPageToLoad(driver);
Set<String> handles = driver.getWindowHandles();
handles.remove(currentHandle);
if (handles.size() > 0)
driver.switchTo().window(handles.iterator().next());
System.out.println(driver.getTitle());
driver.close();
driver.switchTo().window(currentHandle);
waitForPageToLoad(driver);
No comments:
Post a Comment