Monday, November 24, 2014

How to attach screen shot to Testng report

  • If we can attach these to the Testng html report, it provides an option for the user to better analyze the failure reason. Reporter class allows logging messages to the html report. We can use the same class to attach the screen shots as a hyperlink in the report.
Reporter.log("<a href=" + URL+ ">click to open screenshot</a>");
                 URL – location on either local or network drive

  • TestNG you can generate 2 types of report. (Custom TestNg Report )

       1. By implementing ITestListener you can generate a real time reporter where                              individual test case pass/fail status can be displayed in realtime.
       2. By implementing  IReporter you can generate a beautifully designed report that will be              generated once all the test suites have been executed.
http://seleniumexperience.wordpress.com/2013/07/25/generating-custom-reports-with-testng/
https://www.packtpub.com/books/content/logging-and-reports

No comments:

Post a Comment