Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98825

Getting difficulty to focus on newly open window in selenium

$
0
0

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();

Viewing all articles
Browse latest Browse all 98825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>