How to include screenshots in ReportNG report?

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-

Screenshot

2: Now take the screenshot after some actions and pass through Reporter.log method to ReportNG report-

Screenshot1

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-

screenshot3

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s