Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
828 views
by Contributing Tester (29 points)
How can we run TestNG project using command prompt? I am using maven.

2 Answers

1 like 0 dislike
by

HI,

Using suite XML Files and surefire plugin :

This allows flexible configuration of the tests to be run. These files are created in the normal way, and then added to the Surefire Plugin configuration

POM:

<plugins>
    [...]
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.21.0</version>
        <configuration>
          <suiteXmlFiles>
            <suiteXmlFile>testng.xml</suiteXmlFile>
          </suiteXmlFiles>
        </configuration>
      </plugin>
    [...]
</plugins>
in cmd  : mvn clean test -DsuiteFile=testng.xml 
1 like 0 dislike
by


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...