I have a web application which I am testing with Selenium and Maven running parallel tests. At the moment, I am defining the login ids for every test. What I need is a solution where I will have a pool of users available to the tests. While the execution runs the tests will pick user ids to login from this pool. Once a parallel test is done the user Id should be released and become available to the next tests. The pool should be monitored and tests should be executed only when one or more users are available so I will avoid failures due to users unavailability.
I am new to this, so I am looking for some ideas / advises how I can implement the above. I am using Java.
You can do this by defining user's availability as boolean. Consider those four classes:
Class to define testUser as a Object:
Class with testUsers:
Class with test method:
Class to perform tests due to user's availability:
Output: