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.



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.

1 Answer

answered by (171 points)
selected by
0 votes
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.