Friday, April 16, 2021

How to provide testng.xml file name at runtime

 






1. How to run testng tests from maven cmd


Prerequisite for Java
1. Java should be installed on your system.
2. Eclipse should be available.
3. Maven Java project should be created.

Prerequisite for TestNG
1. TestNG plugin should be added in eclipse IDE.
2. TestNG dependency should be added in pom.xml
3. TestNG tests should be created in your project.
4. testng.xml file should be created.

Prerequisite for Maven
1. Maven should be installed on your system.
2. Download maven https://maven.apache.org/download.cgi
3. Add maven to environment variables in your system.
4. Run the below command to check maven version

Command : mvn -version



How to provide testng.xml file name at runtime.

Step 1. In pom.xml in place of testng.xml file name give a reference
${fileName}

Step 2. In command add parameter
mvn clean test -DfileName=testng.xml

2 comments:

How to install Java on EC2

***************************************** How to install Java on EC2 ***************************************** To be continued, In this post...

All Time Popular Post