question

hyao123 avatar image
hyao123 asked hyao123 posted

enhancement the "startTime" fields of steps in the test report

hi,

 

To make step execution more clear, we would like  startTime field of steps in the test report using the real start time value instead of the startOffset so that we can quickly find error info in the SUT logs.(of course users can add this value with the start time mannually). After investigation,  i  tried the following way to do this:

 

using one xsl:variable (global) to record the startTime value in TestReportDocument node like

 

<xsl:variable name="start">

<xsl:value-of  select="/report/TestReportDocument/startTime">

</xsl:variable>

 

then use this in the template (of course render-step template

 

<xsl:template match="ExecutedStep">

<xsl:call-template name="steps">

...

xsl:with-param name="startTime"  select="$start"/>

</xsl:call-template>

......

</xsl:template>

 

however, I can't get  the value of startTime using statement like above. is it the right XPath for startTime?? Thanks advance for your help.

iTestresults and reporting
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

IvanS avatar image
IvanS answered IvanS posted

Unfortunately this is not possible due to implementation of report exporting in iTest.

You can refer this topic for more information:

http://forums.fanfaresoftware.com/t5/General-iTest-Topics/HTML-Test-Report-XSLT-Modification-s-for-TimeStamp/m-p/12900

4 comments
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KumarS avatar image KumarS commented ·

It should be possible to do if we can add a helper function which allows one to do "time" additions in XSLT. We can do this as a bug fix so that our users can call the injected function from XSL.We already inject a function to format date/time according to our conventions.

0 Likes 0 ·
hyao123 avatar image hyao123 KumarS commented ·

Glad to know this. Could you please let me know when this can be available? and how can user to  use this function? Thanks in advance.

 

0 Likes 0 ·
KumarS avatar image KumarS hyao123 commented ·

Remember that this is forum for discussion. You should put in your request for this enhancement through official channels i.e. Fanfare support.

 

If you wanted to do this today - you could write a separate tool to post-process all the HTML reports so that they have timestamps instead of offsets. Any iTest testcase or perl script can go through all the generated HTML reports in a folder and change the offsets to timestamps by doing the proper math and writing a new HTML file.

0 Likes 0 ·
hyao123 avatar image hyao123 KumarS commented ·

Thanks for clarification.  I have raised request for this throuth tech support.

I think the elegant way to handle this is  processing through xslt during saving report instead of post-processing. Thanks

0 Likes 0 ·
YujieL avatar image
YujieL answered YujieL posted

I'm not that familiar with xslt, but looking at some of the summary.xslt that iTest ships with, the xpath for summary information always started with TestReportDocument.  I couldn't find any example where it is prepended with "report".  Try removing the report node and see if it works.

1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

hyao123 avatar image hyao123 commented ·

thanks for your quick reply.  it still doesn't work after removing the report node in item.xslt.

however, I use the following code in other xslt editor(stylus studio2010) to debug, it works (input XML is the raw xml file of test report),

 

 

<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="start" select="report/TestReportDocument/startTime"/>
<xsl:template match="/">
    <xsl:message>
        <xsl:value-of select="$start"/>
    </xsl:message>
</xsl:template>

</xsl:stylesheet>

 

any other suggestions? I am not sure if iTest did some other processings before apply template.  Thanks

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.