Just do it!


Specifying suite in maven for testng

Posted in IT, maven by admin on the July 26th, 2012

Using Suite XML Files

Another alternative is to use TestNG suite XML files. This allows flexible configuration of the tests to be run. These files are created in the normal way, and then added to the Surefire Plugin configuration:
In the previously created pom.xml file, you can replace the plugin section with this one, and now instead of running all the tests, you can specify which of them should be run using a testng suite file (in this case called testng.xml).

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>

Leave a Reply

You must be logged in to post a comment.