back
Avatar of Yann Spöri
Author: Yann Spöri
28. February 2019

Creating custom HTML/XML/Junit reports

Via the run-log QF-Test provides a detailed log about the actions it executed during a test run. The overall results of this run-log can be summarized in other reports like the HTML/XML/Junit report.

A not well documented - but gladly used - feature is that it is possible to adapt/change the style/content of these reports to the own needs. Nevertheless, in order to do so, basic programming knowledges are inevitably needed.

The HTML/XML/Junit reports are customizable. So the content of the "name" and "package" attribute can get changed.

The HTML/XML/JUnit-Reports are generated via an XSLT-Transformation. The therefore needed XSLT-Sheets are located in the directory

<Path to the QF-Test Installation directory>\qftest\qftest-$(version)\report.

If you are changing these Sheets, you may want to copy/move them to the system directory of QF-Test.

As the XSLT-Transformation-Sheets in this directory are preferred over the XSLT-Transformation-Sheets in the <Path to the QF-Test Installation directory>\qftest\qftest-$(version)\report directory. Thus, your modified XSLT-Sheets will then also be used by later QF-Test versions. However - as an disadvantage - whenever a new QF-Test version is coming out with any XSLT-Sheets improvements, you will not notice these improvements anymore, as QF-Test will keep using the Sheets in the system directory.

Notes

  • The XSLT Identity Transformation may be used in order to get the original XML Document out of which the HTML/XML/JUnit-Reports are getting generated:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="@*|node()">
   <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
   </xsl:copy>
 </xsl:template>
</xsl:stylesheet>

  • When generating an HTML report, you may want that QF-Test copies additional files (like additional JavaScript or stylesheet files) into the generated target directory. It is possible to inform QF-Test about such files. Therefore one simply creates a file with the name 'files-to-copy.txt'. In this text file the additional JavaScript, stylesheet or image files are specified. (One file by line.)

Comments are disabled for this post.

0 comments