RE: Want to open new tabs and switch between them


I have a scenario in which I need to open 2 tabs in the same browser and then perform actions that will run in a loop.

After the loop (set of actions) is complete then close the browser.

Is it possible to open 1st tab -> perform respective actions -> then open 2nd tab and perform  respective actions -> repeat these steps around 20 time s and then close it ????

som Train Asked on January 15, 2015 in Selenium WebDriver.
Add Comment
2 Answers

Switching tab is not the official supported scenario by Selenium because each tab has same handle and its not possible to distinguish between the two.

But the truth of the matter is two tabs is same as two windows in terms of your application testing. So have two windows opened up instead of two tabs. Then you can follow this tutorial


Professor Answered on January 21, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.