<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.