Search code examples
mavenselenium-webdrivercucumberqaf

How to run only failed test cases in QAF?


We have close to 100 test scenarios based on QAF in feature files. I have a testng file which I invoke from command prompt through "mvn test" command.

Some tests fail occasionally, but when I run them again they pass. Is there some way where I can run only the failed test cases again?


Solution

  • There are two ways to run failed tests:

    1. run failed test immediately it failed by setting retry.count property. Refer list of properties
    2. Run failed test after completion of entire execution by running generated failed test xml file under test results.