Generate TestNG Reports Using Jenkins | Software Testing Material

In the earlier post, we have seen How To Run TestNG Scripts (testng.xml) Using Command Prompt and Using Batch file (.bat). Also we have seen How To Run TestNG Scripts Using Jenkins. In this post, we show you how to generate TestNG Reports Using Jenkins. To do this, we need to have the following

i. TestNG Project
ii. Jenkins – Check this post on Installation of Jenkins.
iii. TestNG Results Plugin in Jenkins

Don’t Miss: Selenium Complete Tutorial

How To Generate TestNG Reports Using Jenkins

Let’s get started on How To Create TestNG Project.

Step 1: Creating TestNG Project. Follow this link to create TestNG Project.

Must Read: TestNG Complete Tutorial

Step 2: Installing Jenkins. Follow this link for Installing Jenkins

We have TestNG Project and Jenkins ready. Moving forward to Step 3

Step 3: Installing TestNG Reports Plugin In Jenkins

Open Jenkins (localhost:8080) and click on ‘Manage Jenkins‘ and click on ‘Manage Plugins

Click on ‘Available‘ tab and select the check box against ‘TestNG Results Plugin‘ and click on ‘Install Without Restart

Open the ‘TestNGProject’ Job which we have created earlier. Refer this link on How To Create TestNG Project on Jenkins.

Click on ‘Configure’ and scroll down to ‘Post Build Actions’ and click on ‘Add Post Build Actions’ drop down list.

Select ‘Publish TestNG Results‘ 

Enter TestNG XML Report Pattern as ‘**/testng-results.xml‘ and click on ‘Save‘ button

We have created a new project ‘TestNGProject‘ with the configuration to run TestNG Tests and also to generate TestNG Reports after execution using Jenkins.

Let’s execute it now by clicking on ‘Build Now‘ button. It will invoke testng.xml from the batch file.

Right click on Build Number (here in my case it is #1) and click on Console Output to see the result.

Once the execution is completed, we could see a link to view ‘TestNG Results’

This way, we could generate TestNG Reports using Jenkins.

Generating TestNG Reports Using Jenkins

Rajkumar SM is a founder of SoftwareTestingMaterial. He is a certified Software Test Engineer by profession and blogger & youtuber by choice. He has an extensive experience in the field of Software Testing. He writes here about Software Testing which includes both Manual and Automation Testing. He loves to be with his wife and cute little kid 'Freedom'.

3 thoughts on “Generate TestNG Reports Using Jenkins | Software Testing Material”

  1. YOUR ARCTICLE ARE VERY informative and there are too much things to learn

    • Thanks for your kind words Ravi. Keep visiting.

  2. Awesome RajKumar , yours article are informative and up to date.


Leave a Comment

Share via
Copy link
Powered by Social Snap