Parallel execution of features in cucumber using Junit

I am using Selenium, Java, Cucumber, Junit in my automation framework. I have 20 features in my regression suite which uses 2 set of login credentials to execute the testcase ( 10 features use USER1, remaining 10 features use USER2 credentials to login and proceed with the test ) The limitation in the application under test is it will not allow the same user to login in separate browsers at the same time. I wanted to achieve parallel execution in 2 threads specifying all the features which uses USER1 credentials to run in one thread and the remaining 10 features which uses USER2 credentials in another thread

Could any one please let me know how to achieve this?

4 Likes

Hey @sowndarya.sri

You mentioned you have 2 different USER credentials for the login, and want to run test using each on different threads.

So in this case, the condition ā€œthe application under test is it will not allow the same user to login in separate browsers at the same timeā€ wonā€™t be violated.

So basically this is your requirement: Feature 1 (e.g. feature1.feature) : 10 tests/scenarios on Browser1. Credentials being used are of USER1 Feature 2 (e.g. feature2.feature) : 10 tests/scenarios on Browser2. Credentials being used are of USER2

Parallel mechanism to be used is ā€˜methodsā€™ where method from each feature file will run in parallel. Is the requirement well understood? Based on this, we have to check whether parallelism should be performed at methods level or scenario file level.

If this is not the case, then please share some more insights.

3 Likes