When I am running the cucumber test from testng.xml
, scenarios are not executed in parallel. Scenarios are executed one after another. I am using the threads and parallel configuration in testng.xml
file and using the surefire plugin for running the features.
In the Testrunner I have mentioned the website folder where I have got multiple feature file.
So when I run the test using Maven, it always executes the feature files one after another and not in parallel. What's the best way to achieve that?
Please check below configuration:
**Version of testng:**
<org.testng.testng.version>6.14.2</org.testng.testng.version>
<io.cucumber.cucumber-testng.version>2.4.0</io.cucumber.cucumber-testng.version>
**Surefire Plugin configuration from pom.xml:**
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version></version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>Testng.xml</suiteXmlFile>
</suiteXmlFiles>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
**Testng.xml file:**
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Local" parallel="tests" thread-count="5" verbose="2">
<listeners>
<listener class-name="driver.LocalWebDriverListener" />
<listener class-name="reports.ExecutionListeners" />
</listeners>
<test name="Test in Chrome">
<parameter name="browserName" value="chrome" />
<classes>
<class name="testRunner.Windows7Chrome60" />
</classes>
</test>
</suite>
**TestRunner file in which Website is the folder where I have got multiple features:**
@CucumberOptions(
strict = true,
monochrome = true,
features = {"src/main/java/features/Website"},
dryRun = false,
glue = {"driver", "stepDefination", "testRunner" },
tags = {},
plugin = { "pretty", "json:target/RawJsonResult/Windows7Chrome60.json"}
)
public class Windows7Chrome60 extends AbstractTestNGCucumberTests{
}