I am running selenium-testNG scripts using below command so that I can run it in a particular server that I choose to
mvn clean test -Pqa
But the test script is running in the default server url instead
pom.xml:
<profiles>
<!-- Profile for QA environment -->
<profile>
<id>qa</id>
<properties>
<server.url>"https://my_qa_url.com/"</server.url>
</properties>
</profile>
<!-- Profile for Production environment -->
<profile>
<id>prod</id>
<properties>
<server.url>"https://my_prod_url/"</server.url>
</properties>
</profile>
</profiles>
java class:
public static final String REGRESSION_SERVER = System.getProperty("server.url","https://my_default_url.com/");
Command used:
mvn clean test -Pqa
Expectation:
Tests run in the server specified in the profileID qa , ie, https://my_qa_url.com/
Actual:
Tests ran in default url, ie, https://my_default_url.com/
Please provide some pointers to resolve
3