Reports by Extent Reporting plugin

Selenium does;tn come with any reporting  feature, as a automation tester its responsibility to capture good reporting and present to management team. So in earlier post we have seen reporting with ReportNG and XSLT report plugin, now in this post we see another free plugin called ExtentReports.

About ExtentReports

  • Very simple to use API
  • Beautiful and responsive UI
  • Provides dashboard for the entire run
  • Parallel execution of classes and methods supported
  • Creates a single report file, so less management of artifacts required (Online only*, Offline report stores all artifacts locally)
  • Separate section for categories, provides analysis of tests by category
  • Easily integrate test-runner logs
  • Can be customized heavily using an external config file
and this is developed by http://extentreports.relevantcodes.com

Step1: Download all necessary jars - go to this link http://extentreports.relevantcodes.com

Step2 : 

ExtentReports is an open-source reporting library for test automation. It is very easily integrated with all test-frameworks (TestNG, JUnit, NUnit etc.) and provides better looking reports. Because Extent is created as a logging utility, it is also possible to use custom logs for each test, add snapshots & videos, assign categories and authors and filter using several parameters. Below are a few quick features of Extent:

Step3 : Create a simple TestNG script (under package package com.testNG; 
and this will log into https://anukotimetracker.com.login.php



Step5 : Make sure that to add all the necessary jar;s that already downloaded
extentreports-java-2.40.0.jar
freemarker-2.3.23.jar
soup-1.8.3.jar
sqlite-jdbc-3.8.11.1.jar
and also make sure latest selenium jar added.






Step6 : Create xml like (testing.xml) and call the listener and anuko timesheet testNG class file

<?xml version="1.0" encoding="UTF-8"?>
<suite name="Sample Suite" verbose="1" >
<listeners>
<listener class-name="com.extentereports.listener.ExtentReporterNG" />
</listeners>

  <test name="run testng files" >
    <classes>
         <class name="com.testNG.AnukoTimeSheet"/>
        
    </classes>
  </test> 
</suite>

Step7 : Right click and run the file as TestNGSuite




Step 8: Once ran successfully go to your package folder and view the report 
ex. your project path/test-output, and look for the file ExtentReportsTestNG.html





Step 9 : Open the ExtentReportTestNG.html file and should look like this 






Thanks
Gururaj





No comments:

Post a Comment

Note: Only a member of this blog may post a comment.