'Displaying custom HTML or XML reports with Jenkins

I have generated custom XML reports through testing. is it possible to display these XML with Jenkins? If possible, then how to display it with Jenkins?



Solution 1:[1]

If it is a homebrewed XML, I would suggest that you first convert it to HTML then use the HTML Publisher Plugin

https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin

Otherwise, mark it as a build artifact and allow users to download it from the Jenkins job.

Solution 2:[2]

First you have to:

  1. Configure listeners in your testNg.xml file.
  2. Write the listeners classes.

Then, configure Jenkins to show the custom report after your builds:

  1. Go to "Post-build Actions" -> Choose "publish html reports".
  2. Add your directory where the custom report is, for example: /test-output
  3. Add the index file under Index page[s], for example: custom-report.html

Run your build an see your custom html report on Jenkins.

Solution 3:[3]

Install HTMLPublisher plugin in Jenkins and after that perform the steps mentioned by Eyal

Solution 4:[4]

There is this summary display plugin as well: https://wiki.jenkins.io/display/JENKINS/Summary+Display+Plugin

Sample summary display from XML

Solution 5:[5]

Badge plugin

Usage in a pipeline:

def icon = "info.gif"
createSummary(
  icon: icon,
  text: """<h1>My Custom Summary</h1>"""
)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jocce Nilsson
Solution 2 Eyal Sooliman
Solution 3 QA Automation tester
Solution 4 Fakrudeen
Solution 5 Moshe