NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

customize On the fly report generation

I am in the process of editing Reportgen_html.seq to create seperate reports for every sequence call and link the reports to the main report using hyperlinks. I just realized that if i have On the Fly Reporting enabled, Reportgen_html.seq never gets called. Just wondering how do we customize the on the fly reporting behaviour? Is there any other way?
0 Kudos
Message 1 of 11
(5,437 Views)

It depends on your configuration of Initialize the On-The-Fly Report Generator Object

0 Kudos
Message 2 of 11
(5,423 Views)

Try looking into the Sequences referenced in this KB. If this doesn't help, describe, in more detail, what exactly you are trying to achieve. Also include what you have tried and what the results have been.

 

Cheers,

---

Peter Flores
Applications Engineer
0 Kudos
Message 3 of 11
(5,400 Views)

HI Peter,

 

All i need to do is create separate html reports whenever there is a Sequence call step type. I have attached a simple sequence which calls three sequences. I need a separate report for each sequence call. For example, Sequence1.html, Sequence2.html and Sequence3.html. Also an another report which has links to all three reports.

 

What i have done so far is edited the Reportgen_html.seq so that when it detects a step with StepType=SequenceCall, it calls a labview module to create a report and add all the step details and closes the report. Also i have managed to include a hyperlink in the main report. Copy my reportgen_html in your models folder. Please run the Create Single Report.Seq and you will see what i have done so far.

 

I would like to make few improvements. Instead of creating a report with Labview, i would like to do it with Teststand. I can see how Teststand adds data to the report (in TestReport callback), but could not figure out where exactly Teststand opens the report and closes the report after finishing it. In the process model it gets the report file path, resets the report but still not sure how it manages opening a new report and closing it when it finishes.

 

The next challange is port all these changes to On the Fly Report generation. OTFRG, obviously calls a different sequence. It does not call Reportgen_html.seq. May be it calls ProcessOTFStepResult, i am not sure

 

I have also tried executing the sequence in a separate execution. Yes, it does create separate html report, but adds significant Overhead to my sequences which is totally not acceptable. 

0 Kudos
Message 4 of 11
(5,387 Views)

This thread gives a good rundown of a couple ways to proceed.

 

A good way to implement most of this would be by overriding the ProcessModelPostResultListEntry callback. Copy your process model into the TestStand Public directory, or copy the ProcessModelPostResultListEntry to your sequence file before editing it. This way you can always revert back to the default if needed.

 

The RunState.CallingStep.Sequence.Name will allow you to test if you have finished a step in the "Main Sequence" and create a new report accordingly. See if this helps...

 

2010-02-22_192602.jpg

---

Peter Flores
Applications Engineer
0 Kudos
Message 5 of 11
(5,366 Views)

Thanks Peter. I have managed to do what i need. Here are the steps i used to create separate reports.

 

  1. Under Report options, i changed the file name/direcotroy options to Specify Report File Path By Expression. I used an expression like this "T:\\TestResults\\"+RunState.Sequence.Parameters.sequence+"_Report.<FileExtension>". This instructsTestStand to create separate report with the sequence file name as the name of the report.
  2.  Under Contents tab, i changed the report generator to be a sequence rather than a DLL.
  3. I created a new step type called TC_SequenceCall, which is very similar to SequenceCall step but with a post expression like this Step.Result.ReportText="<A href='file:///"+"T:\\TestResults\\"+ Step.TestCaseName +"_Report"+".html'"+">"+ Step.TestCaseName +"</A>". This is to generate a hyperlink to the individual report. Also the execution option was changed to Use New Execution and under Sequence call advanced settings, the wait for execution to complete was changed to "Before Executing next step"
  4. I changed the reportgen_html.seq. Under PutOneResultInReport there is a step called Add SequenceCall Result To Report. I changed the pre-condition to PropertyExists("Parameters.Result.TS.SequenceCall") &&(Parameters.Result.TS.StepType!="TC_SequenceCall"). By doing this,the report generator makes a recursive call only if the step type is SequenceCall. 
  5. By doing all the steps, i manged to get reports attached with this post. This works with On the Fly report Generatoras well.
I am not sure whether this is best way. But it works really fine. I intend to use the TC_SequenceCall only for items that require a separate report. Thanks again for all your replies
0 Kudos
Message 6 of 11
(5,362 Views)

Looks good, thanks for posting your solution!

 

Cheers,

---

Peter Flores
Applications Engineer
0 Kudos
Message 7 of 11
(5,341 Views)

Hi,

 

I 'm trying this code but i have an error "'The post-expression for the step 'Add hyperlink' could not be evaluated. Unknown variable or property name 'Parameters.Result.TS.SequenceCall'. in the  genereport_html file.

 

Nathan, please, can explain me how to use ' Step_testCaseName" for the reports.

 

Thanks you.

0 Kudos
Message 8 of 11
(4,771 Views)

HI Cheknom,

 

You can add a property for the sequence call step type you created and call it as TestcaseName.Then you will be able to use Step.TestcaseName for the reports. If you still get the post expression error, please post the sequence file, then it will be easy for me to find the issue.

0 Kudos
Message 9 of 11
(4,745 Views)

Hi Nathan,

 

Thank you for reply,

 

I solve the probleme by use another issue

I set a stationglobal to count the cycle. At each cycle I get the value of this Stationglobal in the report file ( configure report menu).

 

 

. But I have probleme when I run my sequence for long time. "Operation Failed" Error code -17500 source 'TSAPI' in Sequence editor.

Do you knox this ?

0 Kudos
Message 10 of 11
(4,718 Views)