So, I have a couple of JUnit
classes, each one contains a list of test methods.
Each method is independent of each other, there is no direct connection.
But we have indirect connection: all methods processes one singleton object (it is Selenium Web Driver
Instance, yes, I use 1 Web Driver
Instance for all my tests, because for making new object instance we spend a really lot of time! ).
And It is all ok, when test methods execute step by step in one thread. But it is too long too,
So, I decided to increase speed, How? - I decided to run all the test methods in the parallel mode. For this I use maven with the special configuration for parallel test execution.
But I think, it is a source a new problem, because - in result we have parallel methods execution, but we still work just with single Web Driver Instance.
I'm trying to find the optimal solution:
I want that the tests will be executed in parallel mode - it is really fast.
I don't want that for every test new object is created - it is a very long process.
What advice can you provide for me?
How would you have solved this problem?