Advance Reporting for Auomated Software Test Using ReportNG

  • Tapas Mahato
  • 0
  • 2017-05-25

This is Open Source software, a simple plug-in for the TestNG which is a simple framework to generate HTML reports as a replacement for the default TestNG HTML reports.

To use ReportNG reports we need to follow the below three steps:

  1. Download respective reportng package and extract it & add jarfiles to your project build path.

Download latest reportng.jar from here .
Download
latest velocity-dep.jar from here .
Download
guice.jar from here .

If you are using a maven project for your test automation then add below dependency to your pom.xml file :

XML:

<dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.4</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.testng</groupId>
                    <artifactId>testng</artifactId>
                </exclusion>
            </exclusions>
</dependency>
<dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>3.0</version>
</dependency>

 

2. Now add below listeners to testng.xml file under  tag.

<listeners>
<listener class-name="org.uncommons.reportng.HTMLReporter"/>
listeners>

 

Finally your testng.xml file look similar like below:

xml version="1.0" encoding="UTF-8"?>
DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Jenkins Implementation">
<listeners>
<listener class-name="org.uncommons.reportng.HTMLReporter"/>
listeners>
<test name="Demo Test 1">
<classes>
<class name="com.sample.jenkins_demo.LoginTest" />
classes>
test>
<test name="Demo Test 2">
<classes>
<class name="com.sample.jenkins_demo.AddReviewTest" />
classes>
test>
suite>
  1. Now run your test either TestNG Suite or maven test.

    If you are running as a normal TestNG suite you will be able to see under test-output folder html folder is generated which contains ReportNG report.

    If you are running as maven test then under target > surefire-reports 'html' folder will generated which contains ReportNG report.



4. Open index.html from html folder in browser, you will be seeing a good interactive ReportNG report for your test result.

 

Follow Teknotrait Solutions on

Comments (0)

Recommended Read

Buzzing