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中,因爲外部鏈接在新瀏覽器中打開。我不能夠處理的情況下