Reputation: 313
I want to run test in parallel. My driver is instantiated in base constructor and url and login are done in @BeforeTest.
While running parallel = 'classes', @BeforeClass is not working correctly. Please find link to demo project https://github.com/reactJestuser/DemoParallelRun/tree/master/DemoRun
I am running 2 test in parallel, one browser opens and login credentials are entered twice while for other test only browser is instantiated, url and login details are not entered.
Also, is there any way I can use same session to run test in parallel? so that every time browser is opened, its already logged in.
Upvotes: 0
Views: 199
Reputation: 9058
The driver variable in Base.java
is static and is not thread safe. It is storing state across instances. Make it non-static.
Upvotes: 1