0
在下面的代码多个窗口,处理在IE和Chrome浏览器
//Element clicked in parent window
driver.findElement(By.id("ID")).click();
//Once after clicking the ID, system takes the user to a different tab in chrome and launches an external link
//In IE the same external link will launch in a new browser which is different from chrome behavior
Iterator<String> browsers = driver.getWindowHandles().iterator();
while(browsers.hasNext()){
driver.switchTo().window(browsers.next());
//Element to be clickable in the child window or external site
driver.findElement(By.xpath(".//button")).click();
谁能帮我我们如何处理的情况下,我想一些东西,无论是在IE和Chrome工作。目前上面的代码在chrome中工作,但不在IE中,因为外部链接在新浏览器中打开。我不能够处理的情况下