I am developing a hybrid framework that is used for testing UI and API.
I want to execute the same tests in QA and UAT environments. I have .properties file for qa and uat. And a testng.xml file that will execute the tests. I have UI and API tests that are environment specific.
I want to define a universal environment variable that when passed during maven execution (mvn test) will be read by the .properties file reader before executing the UI or API tests - How / where can i define this environment variable ?
When the above configurations is added under maven-surefire-plugin in pom.xml file, required testng.xml file can be executed in required environment and browser. e.g.,