Display Execution Date in soapUI HTML Report

Today, in this article I shall be discussing on adding Execution Date and time details while generating HTML soapUI reports dynamically.
To achieve this we need to tweak the junit-noframes.xls sytlesheet a bit. Follow the below steps:
  • Open junit-noframes.xls in any text editor.
  • Find “TITLE” i.e. <xsl:param name="TITLE">Unit Test Results.</xsl:param>
  • Comment it and add the below  lines of code
<xsl:param name="TITLE">soapUI Test Execution Report </xsl:param>
<xsl:param name="EXEDATE"><xsl:value-of select="java:format(java:java.text.SimpleDateFormat.new('dd-MM-yyyy hh:mm aa'), java:java.util.Date.new())" /></xsl:param>
  • Now find “$TITLE” and under pageHeader add the below lines of code just below <table width=”100%”>
    <tr>
        <td align="left"></td>
        <td align="right"><b>Execution Timestamp : </b><xsl:value-of select="$EXEDATE"/></td>
    </tr>

Below is the working screenshot for the same.





Display Execution Date in soapUI HTML Report Display Execution Date in soapUI HTML Report Reviewed by Suntaragali The Smart Techie on November 24, 2013 Rating: 5

6 comments:

  1. Hi Suntaragali,

    Thanks for your Well explain step. I am able to generate report. But when I am using display-execution-date-in-soapui. I am getting the below error.

    testreport:
    [junitreport] Processing C:\soapUIReports\TESTS-TestSuites.xml to C:\so
    ts\HTML\junit-noframes.html
    [junitreport] Loading stylesheet C:\TestFiles\ant\etc\junit-noframes.xs
    [junitreport] : Error! Namespace prefix 'java' is undeclared.
    [junitreport] : Error! Namespace prefix 'java' is undeclared.
    [junitreport] : Error! Namespace prefix 'java' is undeclared.
    [junitreport] : Fatal Error! Namespace prefix 'java' is undeclared.
    [junitreport] Failed to process C:\soapUIReports\TESTS-TestSuites.xml

    Could you please help to achieve this.

    ReplyDelete
    Replies
    1. Shashi Singh.

      It doesn't know what is Java because JAva is not declared in the file.

      To resolve this.

      Add the below in the top of the noframe.xsl file.

      On the third line you will see this line.
      xmlns:lxslt="http://xml.apache.org/xslt"

      under this add the below line of code.
      xmlns:java="http://xml.apache.org/xslt/java"
      exclude-result-prefixes="java"

      I also got the same error when I added this, its working fine now. I could see the report with time execution.
      Thanks Suntaragali once again for your effort.

      Delete
  2. Hi,
    I configured as mentioned. And also I am able to run successfully without any error but the execution time is not displaying and header is also not changed. :(
    It will great you can help us.
    Thanks a lot in advance.

    ReplyDelete
  3. Hi,

    However, where would the file be located. I couldn't find it?

    ReplyDelete
  4. not able to location report after making these changes...

    ReplyDelete
  5. hi, follow this link on youtube. It worked for me
    https://www.youtube.com/watch?v=WE5VyaCGdn0

    and then as someone mentioned above do the following changes
    Shashi Singh.

    It doesn't know what is Java because JAva is not declared in the file.

    To resolve this.

    Add the below in the top of the noframe.xsl file.

    On the third line you will see this line.
    xmlns:lxslt="http://xml.apache.org/xslt"

    under this add the below line of code.
    xmlns:java="http://xml.apache.org/xslt/java"
    exclude-result-prefixes="java"

    ReplyDelete