6

I have been generating junit xml report till now for my Protractor tests, but as tests are increasing I need to get a HTML report for the tests. Can we change the junit xml report to HTML using XSLT? If yes, can I have XSLT file for the same.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
mohit
  • 779
  • 3
  • 9
  • 16
  • yes.. you can translate XML into HTML using XSLT.. Here is a w3school XLST 'client' example. http://www.w3schools.com/xsl/xsl_client.asp.. which uses Ajax and XHR object to do so. – Brett Caswell Mar 04 '14 at 06:59
  • 1
    I'm surprised nobody has created a generic XSL style sheet to use for transforming JUnit XML output. If there was one, you could obviously use it to transform the xml. If you search google hard enough I bet you could find one. – djangofan Jun 07 '14 at 01:13
  • If you like javascript and its environment the library [grunt-junit-report](https://www.npmjs.com/package/grunt-junit-report) uses a xslt process to generate some HTML files. – Joel Gaujard - Dépil Tech Sep 25 '17 at 12:59
  • This tool will also transform your junit XML file into a nice-looking HTML file : https://www.npmjs.com/package/junit-viewer Doesn't allow for much (any) style modifications as far as I can tell, but if that's not an issue, it's worth a look – Bavo Van Achte Feb 10 '17 at 15:25
  • 1
    I've been after this for years, so I finally sat down the other day to fulfil this aim. I've created `junit2html` and it can be found here: https://github.com/inorton/junit2html – IanNorton Jun 21 '16 at 20:35

1 Answers1

5

The solution can be to convert JUnit XML files to HTML files using the XSLT . You can find the XSLT file in the answer of this question: What XSLT converts JUnit Xml format to JUnit Plain format

You can use XSLT to create custom manual reports as in Custom JUnit Report?

You can use Ant to create HTML reports as in how can i create a html report for the junit xml report manually?

Community
  • 1
  • 1
Manu
  • 2,251
  • 19
  • 30