Reputation: 1980
I'm still learning to use Selenium and come up with this question, supposed that I want to open 2 same browsers (2x firfox) at the same time, for the first browser I want it to navigate to google.com and search for the first keyword then click on the first link. In the mean time, the second browser will navigative to google.com and search for the second keyword then click on the first link. Those actions are happening at the same time so they will (or may) close at the same time to save time.
Can you please point me to the right direction what do i need to read or look into in order to archive this task? I read another post on Swing Worker but that's another multi-threading thing. My naive approach is to create a new driver then start them at the same time, but is it any other ways?
Thank you.
Upvotes: 0
Views: 3911
Reputation: 1609
Yes with multithreadingyou can achieve this. A simple way can be to create multiple threads of each testcase in your launcher file and each testcase can create its own web driver object and maintain it. Just implement thread in your test case and off you go. And yes after that you can create a jar and run them on different machines.
Upvotes: 0
Reputation: 362
Kindly refer below to run parallel browser testing using TESTNG :
TestNG - Parallel browser testing
You will also get best tutorial for selenium web driver and testNG at Selenium Web driver tutorial
Upvotes: 0
Reputation: 16201
With the help of maven and TestNG this can be accomplished. Check this answer and git maven template
Upvotes: 1