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

0 like 0 dislike
241 views
by Master (1.2k points)

2 Answers

1 like 0 dislike
by Contributing Tester (66 points)

For my knowledge, there is no straightforward option to run only failed test cases from the extend.html file, but we can handle it programmatically.

  • First, check any test cases failed from the extent.html file using parsing options like JSOUP
  • If any test cases failed, then fetch only the failed test cases name.
  • Then automatically generate a testng.xml file with the test cases name fetched from HTML file.
  • Then trigger as Run by TestNG or something.
  • If no test cases failed, just replace the dummy testng.xml file with the template.xml file which should contain all the test cases. 
  • Then trigger as Run by TestNG or something.

Hope this will help you

 

 

 

 

by Master (1.2k points)
Sure. I'll give it a shot. Thank you :)
0 like 0 dislike
by Contributing Tester (99 points)
The Extent Report is just that, a report. You can't run tests using it, only see the results.

However, TestNG automatically creates a testng-failed.xml file after each run in the \test-output folder. This will be a pre-formatted XML that lists each item that failed in the last run, and will also auto include any custom parameters / etc that you might be using.

Using that you can run all those failed tests again after the run, the same way you run any other XML testNG file


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!

...