seleniumtestng-eclipse

Execute TestNG.xml in dry run mode via eclipse


Is there a way to execute TestNG.xml in dry run mode so that I can figure out what methods gets qualified for the test run. I am using Eclipse and intend to run the tests via testng.xml. How to configure Run Configurations for this. Newbie to Selenium-TestNG and Eclipse

I tried to provide -Dtestng.mode.dryrun=true in Run Configurations -> Arguments tab under both Program argument and VM arguments

The run configurations had no effect on the execution. The tests were executed in normal fashion. I expected the configurations would just list test methods in the console


Solution

  • You are going to see all tests with no failures. That what you expect when you run testNg with the argument. To check the dryrun argument works, make your test to fail. Then run your test with "-Dtestng.mode.dryrun=true". Add the argument in "VM arguments"

    Also, check your version of testNG is 6.14 or higher