locked
switch to new window not working in IE11 windows 7 in selenium RRS feed

  • Question

  • Hi

    when I am manually clicking on a link it opens a new tab but while I am doing automation its opening as a new window but in console its showing that it has not switched to the new window and is not able to perform any other operation on the new window

    And according to the script it should click on a link, switch the new window and perform operations on the new window.

    IE VERSION IS IE-11 Windows7. Here is my code,

    Set<String> handles = driver.getWindowHandles();  

    System.out.println(handles);    

    Iterator<String> itr = handles.iterator();    

    Object   firstHandle = itr.next();    

    Object   lastHandle = firstHandle;    

    while (itr.hasNext()) {      

    lastHandle = itr.next();                        

    }  

     driver.switchTo().window(lastHandle.toString());

    I am not able to switch to the new window .

    Friday, October 21, 2016 7:23 AM

All replies