Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

how do I pass testng suiteXmlFile name to Maven through command line

Solved 1 Answers 919 Views Test Automation
0 1

Currently I have selenium tests, we are using testng to execute tests. We use "maven-surefire-plugin" to pass testng.xml suite file name. Is there anyway I can pass it through command line so that I can have "suiteXmlFile" name dynamically passed?


Here is how my current pom.xml file "maven-surefire-plugin" block looks like.



1 Answer

Best answer

Add the following to the maven-surfire-plugin stanza of your pom.xml:


Then you can specify the desired testng suite xml file at the command line:

mvn clean install test -DsuiteXmlFile=testngSuite.xml

Let me know.

answered by (151 points)
selected by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.