How to pass session value in webdriver switchTo().window method -


i need pass session value 1 window other window. sing switchto() method in webdriver, if need new window's findelement(by.linktext). click() event, session value not sending link becoming invalid.

please provide example handles passing session values.

thanks in advance.

venkat

this script helps switch on parent window child window , cntrl parent window

string parentwindow = driver.getwindowhandle(); set<string> handles =  driver.getwindowhandles(); for(string windowhandle  : handles) {    if(!windowhandle.equals(parentwindow))    {         driver.switchto().window(windowhandle);         //perform operation here new window         driver.close(); //closing child window         driver.switchto().window(parentwindow); //cntrl parent window     } } 

Comments

Popular posts from this blog

jpa - Passing entitymanager from reflection method -

frame rate - JAVA simple fps animation(how can i work with?) -