title: Selenium: Run Java code with different URL for three environments
body: <p>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. </p>
  
  <p><strong>sit-config.properties</strong></p>
  
  <p>hompepage = XXX</p>
  
  <p><strong>uat-config.properties</strong></p>
  
  <p>homepage = YYY</p>
  
  <p><strong>Maven Profile</strong></p>
  
  <pre><code>&lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;sit&lt;/id&gt;
          &lt;activation&gt;
              &lt;property&gt;
                  &lt;name&gt;environment&lt;/name&gt;
                  &lt;value&gt;sit&lt;/value&gt;
              &lt;/property&gt;
          &lt;/activation&gt;
      &lt;/profile&gt;
      &lt;!-- mvn -Denvironment=sit clean test --&gt;
  
      &lt;profile&gt;
          &lt;id&gt;uat&lt;/id&gt;
          &lt;activation&gt;
              &lt;property&gt;
                  &lt;name&gt;environment&lt;/name&gt;
                  &lt;value&gt;uat&lt;/value&gt;
              &lt;/property&gt;
          &lt;/activation&gt;
      &lt;/profile&gt;
  
    &lt;/profiles&gt;
  </code></pre>
  
  <p><strong>Questions (EDIT):</strong> </p>
  
  <ol>
  <li>How to load specific properties file based on environment test?</li>
  <li>I got an example for Java Owner library but for testng not Maven. </li>
  </ol>
  
  <p><a href="http://www.testautomationguru.com/selenium-webdriver-how-to-execute-tests-in-multiple-environments/" rel="noreferrer">http://www.testautomationguru.com/selenium-webdriver-how-to-execute-tests-in-multiple-environments/</a></p>
  
  <p>Please help. Thanks. </p>