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 ?
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.
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.