RE: What Maven command we use to execute the TestNG suite through command prompt?

Answered

h

kishore Train Asked on September 7, 2014 in Selenium WebDriver.
Add Comment
1 Answers
Best answer

Hi kishore,

Below is the solution for running testng suite in command prompt using maven command. I think it may help you.

The simplest solution to run tests in parallel is to use the configuration for the maven-surefire-plugin like this:

Usually you don’t need a separate testng.xml file to run the tests, cause they will be run by default based on the naming conventions for tests. Furthermore it’s not needed to make separate include rules apart from that your given definition is wrong.

You can control which tests will run in relationship with TestNG via the groups parameter like this:

Furthermore it’s possible to control which tests will run via the test property like this:

or

A more fine granular way to specify tests from command line is like this:

which run the method myMethod in the MyTest class.

Regards,
Vaidy

Doctor Answered on September 15, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.