cucumber testng parallel testing thread count

62 views
Skip to first unread message

Sadakar Pochampalli

unread,
Jun 16, 2023, 1:55:03 PM6/16/23
to Selenium Users
Hi, I have a cucumber feature file consists of 3 scenarios. I want to enable parallel testing with threadCount=1 in a run and in another run want to set it to threadCount=2.

For below configuration, I am not able to run the parallel testing with thread 1 

1) pom.xml 

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-surefire-plugin</artifactId>

<version>3.1.2</version>

<configuration>

<parallel>methods</parallel>

<threadCount>2</threadCount>

<useUnlimitedThreads>false</useUnlimitedThreads>

</configuration>

</plugin>


2) parallel=true in CucumberRunnerTest.java file

public class CucumberRunnerTest extends AbstractTestNGCucumberTests {


@Override

@DataProvider(parallel = true)

public Object[][] scenarios() {

return super.scenarios();

}


} 3) Not taking testng.xml file for the project so not passing it from surefire.



After all, want to dynamically pass thread count from mvn test command line.


Any thoughts, please share.

Reply all
Reply to author
Forward
0 new messages