Parallel Test Execution with Maven


#1

The easiest way to execute your tests in parallel on one endpoint with Maven is to add this line:

<parallel>classes</parallel>

to the configuration of the maven-surefire-plugin in the pom.xml file, which can be found on the root level of your Ranorex Webtestit project.

Note: If you want to execute your tests in parallel, make sure they can be run concurrently. That means they should be self-contained and not depending on a predefined state, but perform the whole process from beginning to test target.

Furthermore, you might also want to change the threadCount parameter in the configuration. (The default value is set to 5.) Here is an example, where the threadCount was increased to 10 and the value of parallel was set to classes, meaning that tests in each class will be run in separate threads.

  <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.21.0</version>
      <configuration>
          <parallel>classes</parallel>
          <threadCount>10</threadCount>
          <suiteXmlFiles>
              <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
          </suiteXmlFiles>
          <reportNameSuffix>${report.name.suffix}</reportNameSuffix>
          <systemPropertyVariables>
              <application.properties>/application.properties</application.properties>
          </systemPropertyVariables>
      </configuration>
  </plugin>

More possible values and settings for parallel test execution can be found in the maven documentation.

Note: Currently, Ranorex Webtestit does not support parallel test execution per method but only per class.


Selenium Grid Integration : Parallel tests fail randomly
How to run Typescript tests parallel in Selenium Grid
Release notes v0.25.0
listed #2

Release notes v0.8.0