I am unable to focus on newly open window using selenium and java. I am using Internet explorer for running my application. The new window is opening but not able to perform anything on the new window. I tried with
Set<String> allwindows = driver.getWindowHandles();
but still issue is not resolved.
Below is the code I am using .
driver.get("www.tririga.com");
String parentwindow=driver.getWindowHandle();
driver.findElement(By.id("login")).click();
for(String childwindow: driver.getWindowHandles()) {
driver.switchto().window(childwindow);
driver.findElement(By.id("submit")).click();
driver.close();
}
driver.switchto().window(parentwindow);
driver.close();