Skip to end of metadata
Go to start of metadata

TestNG has built-in support for running tests in parallel. All you need to do is set a parallelism limit in your Maven pom.xml file or your Ant Parallel task file by updating the <threadcount>.

Match Thread Count to Concurrency Limit

You should match your thread count to your concurrency limit, which is shown in the My Account section of your user profile information on the Sauce Labs dashboard.  

Example of Updating the <threadCount> in a Maven pom.xml file
<build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.4</version>
                <configuration>
                    <parallel>classes</parallel>
                    <threadCount>20</threadCount>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                </configuration>
            </plugin>
        </plugins>
</build>
  • No labels