Any test automation report is incomplete without the screenshots and including them in ReportNG is not that much difficult. In today’s post we will see how we can include the screenshots in ReportNG report. If you are wondering how to configure ReportNg with selenium then you can refer my previous post.
Here I am again considering that you already have below set-up-
- Your project is already set-up in Eclipse
- Project already has testng.xml file.
- ReportNG is already set-up with Selenium and TestNG.
If above conditions are true then you just need to complete two steps-
1: Make it Escape_Property=false like this-
2: Now take the screenshot after some actions and pass through Reporter.log method to ReportNG report-
Now run your testng.xml file and open the test report. If you have configured ReportNG properly and above set-up then you report should look like this-