NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

generate two xml reports from same execution

Solved!
Go to solution

I need to generate a summary report and detail report from the same execution.

Detail report will record all the steps marked as Record result

Summary report to record only the steps that are of type Pass/Fail, Numeric Limit Test, MultiNumeric Limit Test and String test.

So far I have been able to generate two detail report from same execution and can save each report in separate folder.

 

How to get the data for summary versus detail report from the running sequence?

 

*************************************************
CLD
*************************************************
0 Kudos
Message 1 of 11
(3,422 Views)

This is not trivial but let me see if I can make it clear what I would do if I were in your shoes:

 

Basically you have two sections in your picture: Summary and Detail.  I will refer to each as such.

 

In there you have a sequence call named: TestReport Callback.  If you look in the code for that sequence you will see where the text for the report is being generated through a series of sequence calls, ActiveX calls and DLL calls.  The key is to get Parameters.MainSequenceResults to be in the desired state.  Now if you pause somewhere in the TestReport sequence during execution you will see the MainSequenceResults parameter get filled with data.  One of the elements is the TS.  This top level element actually represents the call to your MainSequence from the process model.  Inside you will se a SequenceCall element with a ResultList element.  This is populated with the ResultList from your MainSequence. 

 

Hopefully you can start to see where I'm going with this.  Essentially you have a FileGlobal flag which gets set to either Summary or Detail.  If it's Detail then at the beginning of the TestReport sequence you can make a call to a sequence (which you create).  That will recursively traverse the TS.SequenceCall.ResultList tree and remove the non TestType Step results.  It has to be recursive because you do not know the depth of sequence calls made from MainSequence.

 

The idea is that this ResultList be the Detail ResultList so that the report will generate off of the data in there.

 

Anyhow, that's one idea and I'm sure there are other ways to do it.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 11
(3,407 Views)

Thanks jigg,

 

When I get to the sequence TestReport Callback and step in to call AddReportBody subsequence from Reportgen_xml.seq all that has is a call method GetXML.

This is where I am uncertain as to how to get the summary results? I was planning on using a flag - SummaryReport which if true then record only summary data else record all the data.

Any idea how does Reportgen_xml.seq generates the report? Will I need to modify the xls stylesheet?

Thanks!!


*************************************************
CLD
*************************************************
0 Kudos
Message 3 of 11
(3,390 Views)

You do not need to change anything in Reportgenxml.seq nor do you need to change anything in the stylesheets.  Your only changes should occur in the Process Model and the TestReport sequence.

 

You could have a fileglobal in your process model which you would use as a flag.

 

Add a new sequence to your Process Model that will call itself recursively to remove the results.  This should be called Generate Summary Report or something like that.

 

Then put a step at the top of TestReport which calls Generate Summary Report.  make the precondition your flag.

 

There are 2 parts to reporting: Result Collection and Report Generation

 

Result Collection occurs during execution.  After each step a container with the correct information gets placed in the ResultList array.

 

Report Generation uses that information to generate the report.  This is what the Reportgen_xml.seq is doing.

 

My idea here is that you intercept the collection before the generation occurs.  By doing so you can manipulate the result collection to be what you "want" it to be.  Meaning remove any elements that are not of a certain step type. 

 

Recursion has to be an element of this because the result collection is in the form of a tree.  Meaning MainSequence is the top node.  Any steps would be children.  If a child node is a sequence call then it would have children which are the steps within the sequence being called.  But what if one of its steps is a sequence call with more steps in there?  You don't know how deep the tree would be.

 

Hopefully this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 4 of 11
(3,387 Views)

Thanks for the approach. 

I have created a sequence which recursively looks through the Parameters.MainSequenceResults and if StepType is one of the Test Types then displays in summary report. 

On the summary report I also wanted to get the name of the subsequcenCall if that subsequence call contained a valid TestType for summary report. For example if subsequenceCall step has a Action and String type. I wanted it to display as shown in Image1.jpg below. Currently it displays as shown in Image2.jpg.

Attached is the recursive sequence that I am using. 

 

 

*************************************************
CLD
*************************************************
Download All
0 Kudos
Message 5 of 11
(3,373 Views)
Solution
Accepted by topic author lvrat

Give this one a try.  🙂

 

I only have one Recurse Result List sequence that you would call from your TestReport Callback Sequence.

 

Hopefully this makes sense.  Let me know if you have questions.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 6 of 11
(3,358 Views)

Thanks...worked like a charm:)

*************************************************
CLD
*************************************************
0 Kudos
Message 7 of 11
(3,340 Views)

I see a run time error with the sequence (pls see the attachment).

I have 2 sequence files. When I run 1st sequence file the Run time error does not display. It does happen but the pop up window is not displayed.

Running with the second sequence file the run time window gets displayed.

 

I am using the same process model and calls. Also under the station options->execution I do have drop down selected to Show Dialog.

How can I set the run time error to not display?

 

TIA.

*************************************************
CLD
*************************************************
0 Kudos
Message 8 of 11
(3,330 Views)

Looks like the issue is that I get the StepType as "SequenceCall" but then there is no SequenceCall container. This is for the subsequence calls that are launched in new execution.

How can I check if the ResultList contains TS.SequenceCall or not?

In the image array [3] and [4] are of "SequenceCall" type but array [4] does not has SequenceCall underneath it.

Therefore when recursive call is made array [4] returns run time error.

 

Any suggestions?

 

*************************************************
CLD
*************************************************
0 Kudos
Message 9 of 11
(3,328 Views)

Got it...using the method Exist() and added to the step precondition. Looks something like

Locals.CurrentElement.AsPropertyObject.Exists("TS.SequenceCall",0)

Thanks.

*************************************************
CLD
*************************************************
0 Kudos
Message 10 of 11
(3,324 Views)