Unable to get new window handle with Selenium WebDriver in Java on IE
When I click a button on a page (in IE browser), a new popup page opens. My attempts to get the window handle for this popup have failed. Here is my first attempt: String baseWin = driver.getWindowHandle(); System.out.println(baseWin); Set<String>s = driver.getWindowHandles(); Iterator<String> ite = s.iterator(); while ( ite.hasNext() ) { String popUpHandle = ite.next(); if(!baseWin.equals(popUpHandle)) { driver.switchTo().window(popUpHandle); System.out.println(driver.switchTo().window(popUpHandle).getTitle()); This attempt prints only the base window's handle, and if the second print