2 messages in com.canoo.lists.webtestRe: [Webtest] Calculating Time to run...| From | Sent On | Attachments |
|---|---|---|
| Cynthia A Reece | 26 Apr 2006 12:35 | |
| Denis N. Antonioli | 27 Apr 2006 00:23 |
| Subject: | Re: [Webtest] Calculating Time to run Test![]() |
|---|---|
| From: | Denis N. Antonioli (deni...@canoo.com) |
| Date: | 04/27/2006 12:23:28 AM |
| List: | com.canoo.lists.webtest |
Hi Cynthia
On 26 avr. 06, at 21:35, Cynthia A Reece wrote:
I wanted to modify the reportFromSummary.xsl file to output the time taken to complete a test.
The standard xsl for webtest displays the total time for the execution of a <webtest>.
I had hoped to do this using the <xsl:call-template name="date:difference"> function but the date format of the starttime and endtime elements in testresult don't seem to be in a format I can easily parse.
The standard xsl does it by summing up the step/result/xxx/@duration of every contained steps, which is a counted in seconds. xxx is either completed or failed.
This expression compute the duration of all the webtest from the report
<xsl:variable name="duration.total" select="sum(/summary/testresult/results/step/ result/node()[name()='completed' or name()='failed']/@duration)"/>
But it is easy to restrict to a single <webtest> by selecting its name:
<xsl:variable name="duration.testA" select="sum(/summary/testresult[@testspecname='A']/ results/step/result/node()[name()='completed' or name()='failed']/ @duration)"/>
There is also an xsl template to format the result in h:m:s <xsl:call-template name="time"> <xsl:with-param name="msecs" select="$duration.total"/> </xsl:call-template>
Have fun!
dna
-- Binaries may die but source code lives forever. -- The Halloween Document




