Peter Kozlovsky
Peter Kozlovsky

Reputation: 743

Selenium Java multithreading FirefoxDriver

I want to run parallel test and i have code something like this

for(int i = 0; i < size; i++){
new Thread(()->{
FirefoxProfile profile = new FirefoxProfile();
//fill profile
WebDriver driver = new FirefoxDriver(profile); <- problem here
//all my actions
driver.close();
}).start();
}

But the problem is that the drivers are not created and not open multiple browsers instantly as ChromeDriver , and work consistently. How to solve this problem ?

Upvotes: 0

Views: 3809

Answers (1)

Sadik Ali
Sadik Ali

Reputation: 1205

You should use testng it will provide feature to run test in parallel you don't need to create multi threading concept.TestNg

Can also check below post:

Using multithreading

Using Testng

Upvotes: 1

Related Questions