How switch from new tab to old tab ?

How switch from new tab to old tab and is this possible to use Applet and Swings in selenium?

Showing Answers 1 - 3 of 3 Answers

veerendra

  • Jul 22nd, 2015
 

You can use window handling in selenium webdriver.
First get the handle of the parent window and write a for loop to switch to the child windows.
String parentwdw=driver.getWindowHandle();
//write a code when you click opens another window
for(String wdw: driver.getWindowHandles()){
driver.switchTo(wdw);
system.out.println(driver.getTitle()); //will print the title of new window
}
driver.switchTo(parentwdw); // will switch back to parent tab

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions