Hi All,
I am trying to find out how to run a suite file which has multiple parameters from command line using maven. In IntelliJ to run this I just right click on the suite file and click run xml which runs it and sends the parameters in the suite file to my base class which all of my test cases extend. Is there a way to run the same parameterized suite file from command-line. I use this command to run a suite-file from command-line
mvn test -Dtests=resources/test-suites/audioSuite.xml
The suite-file looks like this -
<suite name="Image Upload Suite Firefox" verbose="1" >
<test name="Image Upload Test" parallel="false">
<parameter name="BROWSER" value="FF" />
<parameter name="VERSION" value="20" />
<parameter name="PLATFORM" value="WINDOWS" />
<parameter name="NAME" value="Simple Image Upload Test" />
<classes>
<class name="audioTestsNodeFormPlus.xxxxxx"/>
</classes>
</test>
</suite>
The base class looks like this -
@BeforeClass
@Parameters({"BROWSER","VERSION","PLATFORM","NAME"})
public void setup(String BROWSER, int VERSION, String PLATFORM, String NAME) throws IOException {
if (BROWSER.equals("FF")) {
DesiredCapabilities capabillities = DesiredCapabilities.firefox();
capabillities.setCapability("version", VERSION);
capabillities.setCapability("platform", Platform.valueOf(PLATFORM));
capabillities.setCapability("selenium-version", "2.32.0");
capabillities.setCapability("name", NAME);
Thanks,
Rivlin