// This will capture all the windows/tab in the browser
ArrayList<String> windowIDs = new ArrayList<String>(driver.getWindowHandles());
//This will move the selenium control to new window or tab
driver.switchTo().window(windowIDs.get(1));
ArrayList<String> windowIDs = new ArrayList<String>(driver.getWindowHandles());
//This will move the selenium control to new window or tab
driver.switchTo().window(windowIDs.get(1));
//This will move back the control to Parent window or main window
driver.switchTo().window(windowIDs.get(0));
إرسال تعليق