Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Status-Untriaged
New issue 3835 by
bmacal...@pch.com: With multiple browsers open
driver.getWindowHandles() returns a set of 1 in IE 8 works fine in IE 7
http://code.google.com/p/selenium/issues/detail?id=3835
What steps will reproduce the problem?
1. Using remotedriver Open site "
https://online.citibank.com"
2. click on the facebook link bottom right to open a new browser instance
3. Then get the Set of open window handles as follows
driver.getWindowHandles()
What is the expected output?
I expect a set of 2
What do you see instead?
A set of 1 the original window handle
See code at bottom
Selenium version: Selenium server 2.21.0
OS: XP
Browser: IE
Browser version: 8
DesiredCapabilities capability = new DesiredCapabilities();
RemoteWebDriver driver = null;
try {
capability.setBrowserName("internet explorer");
capability.setVersion("7");
capability.setPlatform(Platform.XP);
driver = new RemoteWebDriver(new URL("
http://27.101.1.199:4444/wd/hub"),
capability);
} catch (MalformedURLException e) {
e.printStackTrace();
}
driver.manage().timeouts().implicitlyWait(90, TimeUnit.SECONDS);
driver.get("
https://online.citibank.com");
String myWindowHandle = driver.getWindowHandle();
driver.findElement(By.id("cmlink_FacebookIconLink")).click();
// sleep for a bit
try {
Thread.sleep(3000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
// Returns a set of 1 in IE 8 returns a set of 2 in IE 7
Set<String> handles = driver.getWindowHandles() ;
for(String winHandle : driver.getWindowHandles()){
if(myWindowHandle.equalsIgnoreCase(winHandle))
continue;
driver.switchTo().window(winHandle);
}
String shipperURL = driver.getCurrentUrl();
driver.close();
driver.switchTo().window(myWindowHandle);