Lot of time we have a requirement
to run our selenium automation test cases on a different browser, environment or
simply as Smoke, Functional, Regression test.
In this blog, we will
learn how we can achieve this requirement by creating multiple profiles in our testing.xml
file.
To understand this let's take a simple example where we have segregated our automation test script based on the Smoke and Sanity Test and based on client requirement. I wanted to execute either smoke or sanity test. Below is my folder structure
And to execute this automation
scripts I have created two separate testing.xml named Sanity.xml and Smoke.xml.
As you can view, here I have created two separate maven profile one for executing Smoke automation test another one to execute Sanity automation
test.
Now to execute the required profile we need
to go to maven command prompt and use
mvn clean test -P
profile name
i.e mvn clean test -P Smoke
i.e mvn clean test -P Smoke