0

I'am running testng suite and then extent.html report is being generated. Now I want to customize my report like; i should be able to select only failed testcases in my report and then should be able to run them from there only and report should get updated. Any suggestions, how can i achieve this ?

0

Using TestNG's IretryAnalyzer interface's Retry method, you can re-run your failed test cases automatically.

But as far as I know, you can't update the already generated report.

But this should be understandable at your team/organization level as many times test fails not only because there is some defect, but due to internet connectivity loss or slowness or other many factors.

And on side note, try to use best practices as much as possible to automate your test cases so there would be very less or no flaky tests.

  • Thanks, i understand that but is there any way or any other report or some interactive customized way to achieve the same? – Anurvi Tak May 17 at 7:38
  • @AnurviTak As far as I know, there is no such report. You can do custom implementation but it would be a lot of effort and I would suggest to not put that much effort into it and put your effort elsewhere. – SRM21 May 17 at 8:38
0

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.

  • Thanks, i understand that but is there any way or any other report or some interactive customized way to achieve the same? – Anurvi Tak May 17 at 7:39
  • i've already done that which you have described, i've been asked to implement this. Any suggestions on it? – Anurvi Tak May 17 at 7:40
  • I'd be surprised if any report allows for that kind of thing. It sounds like what you're after is a build environment where people can fire off the tests, read the reports within the same environment and then afterwards fire off the resultant failed tests from that build. Have a look into Jenkins Server, this allows for that sort of thing. – Klynt May 17 at 7:53
  • Thanks. I'll check that. – Anurvi Tak May 17 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.