Issue
I'm trying to run my tests from the command line by specifying the test suite from the command line. In my pom file, it says "Cannot resolve symbol 'suiteXmlFile' (for ${suiteXmlFile). It works if I specify the name of WebCheckout.xml in the pom file, butI want to be able to run it from the command line like this:
mvn clean test -Dsurefire.suiteXmlFiles=WebCheckout.xml
I've been following this tutorial:
http://www.seleniumeasy.com/maven-tutorials/choose-selected-testng-xml-files-to-execute-using-maven
My pom file is configured as follows:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
Please can someone tell me where I'm going wrong.
Solution
This is an issue affecting 2.12 (and possible prior versions), so just use a surefire plugin version >= 2.18.1 where it has been fixed. I tried 2.21.0 (latest ATM) and it works as expected (although I have my XMLs in the test/resources
dir so I had to specify -Dsurefire.suiteXmlFiles=src\test\resources\test.xml
)
Answered By - Morfic
Answer Checked By - Mildred Charles (JavaFixing Admin)