question

bgessaro avatar image
bgessaro asked bgessaro posted

HTML Test Report XSLT Modification(s) for TimeStamp

As I am not an XSLT expert by any stretch of the imagination, I am looking for the XSLT file(s) modifications to allow the following report generation behavior:

 

Current: Each "Item" under "Steps" has a "Start Time" column whose values reflect the amount of time elapsed since the test case began execution.

 

Desired: Each "Item" under "Steps" has a "Start Time" column whose values reflect the system time the individual steps began.

 

I understand there is a file ...reports12.2/test_report_templates/HTML/item.xslt that formats the step "Start Time" under <!--~~ format time ~~-->, as well as a file ...reports12.2/test_report_templates/HTML/summary.xslt that contains the system time the test case started executing.  What are the actual changes I can make to these two files to create a test report with the desired output?

iTest
10 |950

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

1 Answer

·
GregM avatar image
GregM answered GregM posted

This isn't going to be easy.

 

The iTest Test Report viewer does have a timestamp column, but the HTML does not.  Apparently, this timestamp is not stored in the database; going by the Raw XML output format of test reports, it looks like start time (//startTime) is stored in the format:

 

yyyy-mm-ddThh:mm:ss.sss

 

and step time offset (//startOffset[stepnumber])

 

s.sss

 

But there does not seem to be a timestamp value for the steps, so these would have to be calculated by the xslt.  That means you would need to create two functions: one to translated the startTime into an absolute number of seconds and one to translate an absolute number of seconds into a timestamp. 

 

For example, the expression

 

substring-after(substring-before(//startTime,':'),'T')*3600+substring-before(substring-after(//startTime,':'),':')*60+substring-after(substring-after(//startTime,':'),':')

 

Will find the number of seconds from midnight...

3 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.

IvanS avatar image IvanS commented ·

Unfortunately it is not possible even if you make function to convert date/time and add seconds.

When execution steps are processed by XSLT there is no access to summary section where execution start time is.

0 Likes 0 ·
bgessaro avatar image bgessaro IvanS commented ·

Thanks for the update; after exploring as many venues as I had time I have come to the same conclusion.  I will enter this as a general enhancement request for a future release.  thanks for following up on this question-

0 Likes 0 ·
dclaar avatar image dclaar bgessaro commented ·

If the XML from the test results were in a text file, the XSLT for the details section could include it and grab the date. Is there any way to do that, given that the results are in the database? Actually, to include it, you would have to know its name, and since the details section doesn't know the name of what it is processing, that won't work.

 

Yeah, I'd like to see this enhancement as well.

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.