I am using Maven Failsafe + TestNG to run Selenium tests. I know that you can pass parameters to my TestNG tests by defining the system properties in pom.xml as follows:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.19.1</version> <configuration> <systemPropertyVariables> <browser>firefox</browser> </systemPropertyVariables> </configuration> </plugin>
My TestNG test refers to this property as follows:
@Parameters("browser") public void setUpClass(@Optional("firefox") String browser) { ... }
However, I was wondering if it is possible to run parallel browser tests in parallel without having to specify the testng.xml file. I tried something like this, but that didn't work. Please rate if you can help.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.19.1</version> <configuration> <systemPropertyVariables> <browser>firefox, chrome</browser> </systemPropertyVariables> <parallel>tests</parallel> </configuration> </plugin>
Is it possible to achieve this only with the pom.xml configuration? Due to the multi-module nature of my project, I do not really like to use the testng.xml file.
source share