Java API for generating Excel report from TestNg xml file

Java API for generating Excel report from TestNg xml file

TesNg is the most widely used testing framework. It provide lots of annotations as well as listeners, using which tester can write wide rage of test cases. Covering unit, functional, end-to-end, integration testing.

TestNg also comes with built in feature of generating the HTML report as well as tester can customize this report using "Report Listener" or "Reporter". Whenever a end user run the test suite using testng.xml, Testng generate a file name "testng-result.xml"

This java api uses the "testng-result.xml" file to generate the excel report. The excel report file will have "TestCase Name" which will be in the form package name appended with class name and then appended with method name.

ex: <packagename>.<classname>.<methodname> , com.testcase.Testclass.testcaseOne

The second column is "Status" which will have pass/fail. The 3rd column is the "Exception" which will have exception name. And the last column is "Exception Message" which will have the stack trace. This api is build using Apache Poi Ver3.10.1

1. The jar can used from the command line by the following command

java -jar TestNgToExcel.jar "<path to testng-result.xml>"

2. The jar can also be imported into existing Java project.

ExcelReport.generateReport(<path to testng-result.xml>);

For the second approach you need to import Apache Poi jars to the project along with api jar.

The project is located at GitHub

Link :- https://github.com/rahulrathore44/ExcelReportGenerator

 

Ashok Kumar HemaChandran

Software QA Tester | HTML5 | Selenium - TestNG Framework | Core Java | API -Postman | Manual Tester | Asana - Project Management Tool

1 年

Lovely work Rahul

回复

要查看或添加评论,请登录

Rahul Singh Rathore的更多文章

  • REST API Automation with RestSharp & HTTP Client

    REST API Automation with RestSharp & HTTP Client

    Currently the IT industry is moving towards Micro Service based architecture. And it is very important to under stands…

  • Cucumber Framework with Selenium Webdriver and Java

    Cucumber Framework with Selenium Webdriver and Java

    This course is all about BDD concept and its implementing framework Cucumber. The course is divided into different…

  • Automation Testing using Selenium & Katalon Studio

    Automation Testing using Selenium & Katalon Studio

    Katalon studio is simple and powerful automation tool. The same tool can be used for creating/writing the automation…

    1 条评论
  • Trx2Excel

    Trx2Excel

    MSTest framework is a popular framework for running the Unit test. When test are run using this framework, usually the…

  • Web Service Testing using Apache HttpClient

    Web Service Testing using Apache HttpClient

    RESTful Web Services are REST architecture based web services. In REST Architecture everything is a resource.

  • Automation approach to extract the unique locator for web element

    Automation approach to extract the unique locator for web element

    Page Object Model is the commonly used design patter for Automation. But the designing of POM takes, lot of manual…

    2 条评论
  • BDD with Selenium Webdriver and Specflow using C#

    BDD with Selenium Webdriver and Specflow using C#

    Behavior Driven Development with Selenium Webdriver and Specflow using C# This course is design for learning the most…

  • Steganography In BMP Images

    Steganography In BMP Images

    Steganography is the practice of concealing a file, message, image, or video within another file, message, image, or…

  • File Upload using Sikuli script

    File Upload using Sikuli script

    When it comes to browser automation, In many scenario you need to upload/download the file to the website or a file…

    1 条评论
  • Taking Multiple ScreenShot

    Taking Multiple ScreenShot

    Taking screenshot is a unique feature provided by Selenium Webdriver. But the mechanism used for taking the screen…

社区洞察

其他会员也浏览了