Set<String> handle=driver.getWindowHandles();
    System.out.println(handle);



    Iterator<String> it=handle.iterator();

    String parent=it.next();
    System.out.println("parent  =" +parent);
    String child=it.next();

    System.out.println("second child  =" +child);
    driver.switchTo().(child);
    driver.findElement(By.xpath("//* 
    [@id="fixHeader"]/tbody/tr[2]/td[4]/a/span")).click();

     Thread.sleep(3000);

     String child2=it.next();

        System.out.println("Third child  =" +child2);
        driver.switchTo().(child2); 



Source link https://sqa.stackexchange.com/questions/35345/not-able-to--to-third-window-in-

LEAVE A REPLY

Please enter your comment!
Please enter your name here