I have an automation testing framework in Java. I need this code run on multiple environment such as SIT, UAT and Prod but all of these environment have different URL.
sit-config.properties
hompepage = XXX
uat-config.properties
homepage = YYY
Maven Profile
<profiles>
<profile>
<id>sit</id>
<activation>
<property>
<name>environment</name>
<value>sit</value>
</property>
</activation>
</profile>
<!-- mvn -Denvironment=sit clean test -->
<profile>
<id>uat</id>
<activation>
<property>
<name>environment</name>
<value>uat</value>
</property>
</activation>
</profile>
</profiles>
Questions (EDIT):
- How to load specific properties file based on environment test?
- I got an example for Java Owner library but for testng not Maven.
http://www.testautomationguru.com/selenium-webdriver-how-to-execute-tests-in-multiple-environments/
Please help. Thanks.