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
Software QA Tester | HTML5 | Selenium - TestNG Framework | Core Java | API -Postman | Manual Tester | Asana - Project Management Tool
1 年Lovely work Rahul