In this “How to Generate Newman Reports on Jenkins in Postman” article, I will be demonstrating how you can implement this concept and get a tight grip over this.
How To Generate Newman Reports on Jenkins
To generate Newman reports on Jenkins, edit command in the Build section.
Command is :
C:\Users\Test\AppData\Roaming\npm\newman run https://www.getpostman.com/collections/8daaf8118386c8fce5ef –reporters cli,junit
Reports will be automatically created inside the Workspace at Jenkins directory. These reports can be viewed from Jenkins Workspace tab or from Workspace folder created where Jenkins is downloaded in our system.
We can open the file and see that test results are in XML format.
Since this report is in XML format, we have an option to publish the report in Jenkins. Publishing report is a part of Post-build Actions. We basically write commands in Post-Build Actions to publish our report.
1. Go to the configure section. Go to Post-Build Actions.
2. Click Publish Junit Test Result Report
3. Enter the path of the file in Test Report XMLs. Save the changes. To build the project again, click on Build Now button.
4. From the Build history section, open the build results. Click on Test Result.
5. We can now see the test results which are easy to understand. We can see how many test cases failed/passed. Failed tests will be shown in red color. We can even see the Test name and its status along with duration.
Learn “Generate advanced HTML reports while using Newman” in the next tutorial.
Author Bio: This article is written by Harsha Mittal an ISTQB-CTFL Certified Software Test Engineer having 3.5+ years of experience in Software Testing.