Cucumber-jvm: How to contoller the threadcount for the cucumber parallel execution ( version :cucumber-jvm 4.2.6)?

Created on 10 Apr 2019  ·  3Comments  ·  Source: cucumber/cucumber-jvm

I don't know how to contoller the threadcount for the cucumber parallel execution.
I have set the threadcount in the pom.xml file, but it not work! please help me~!

below is the information:
cucumber version : 4.2.6, I use it's parallel fuction,

1、pom.xml setting:

<dependencies>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>4.2.6</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>4.2.6</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>4.2.6</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-testng</artifactId>
        <version>4.2.6</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.7</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.14.3</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <testFailureIgnore>true</testFailureIgnore>
                <parallel>both</parallel>
                <threadCount>2</threadCount>
            </configuration>
        </plugin>
    </plugins>

2、RunCukesTest:

public class RunCukesTest extends AbstractTestNGCucumberTests {

@DataProvider(parallel = true)
@Override
public Object[][] scenarios() {
    return super.scenarios();
}

}

In this configuration , the threadCount is 2,but it does not work,all the scenario parallel execute at the same time. Then i try to edit the pom, change the maven-surefire-plugin config like that:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <properties>
                    <property>
                        <name>dataproviderthreadcount</name>
                        <value>2</value>
                    </property>
                </properties>
            </configuration>
        </plugin>

It also does not work,all the scenario parallel execute at the same time.

who can help me?

All 3 comments

Please use the support forums for questions and discussions. We use GitHub issues to track bugs and contributions exclusively.

@kevinchan114 yes you need to use dataproviderthreadcount and it's work fine
maybe you need to specify surefire plugin version

here are working POC https://github.com/sirdir/pom_parallel_testng

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings