RE: Want to open new tabs and switch between them
Hello
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 ????
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
http://www.toolsqa.com/selenium-webdriver/testng-multi-browser-cross-browser/
Thanks
Virender