NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

XML Results file counting number of failures

I am looking to have the XML results files count not only the total number of steps (which it already does), but also the number of failures, which can then tell us the number of passing results.  I have looked through the provided sequence file reportgen_xml.seq, and believe that the step that calculates the number of steps, calls modelsupport2.dll, function AddCriticalFailureStack.  I tried looking at this dll (modelsupport2.prj file in LabWindows), and have located this function, but do not know what to alter, nor how to build a new dll in order to obtain this functionality.  Is this the right place to look, and how would I go about altering the function if it is?
0 Kudos
Message 1 of 5
(3,403 Views)
You might find it preferable to put this kind of information in the header rather than the body.  The function call you are looking at (AddCriticalFailureStack) is located in the body sequence, but it is probably not the best place to add this (first of all, because it's in the report body, and secondly, because it recursively generates each step/calling sequence to trace specific failures).

Probably the best place for this modification would be in AddReportHeader of reportgen_xml.seq in the step "Add Report Element".  Notice that this is where the step count is being displayed, and that would therefore be an appropriate place for the failure count.

Additionally, note that typically when adding elements to XML reports, you need to modify the style sheet as well as the xml generation (<TestStand>\Components\User\Models\TestStandModels\StyleSheets).
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 2 of 5
(3,383 Views)
I agree that I would eventually like the number of failures displayed in the header, however, I can't find a place where the sequence is even keeping track of the number.  I was going to the body sequence in order to create a variable that would count the number of failures as it goes through the results.  If there is a variable that already counts them, then I cannot seem to find it.
0 Kudos
Message 3 of 5
(3,365 Views)
We don't explicitly store the failure count anywhere within the sequence context, but you can calculate the failure count by looking through the ResultList (and recursively branching through the sequence call step results). 

Attached is an example sequence file (modified reportgen_xml.seq) that contains this modification.  Make sure that you put this file in the <TestStand>\Components\User\Models\TestStandModels rather than the NI directory, as with any modifications to the default files in TestStand.  Additionally, find a modified stylesheet attached that reflects the change made in the report generation.

Hope this helps!
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 4 of 5
(3,312 Views)
Thanks, your modification worked perfectly.  I modified it a little to also count the number of passed tests and to add the total number of passed tests and failed tests.  I am attaching the two files that I modified in case anyone would like to use them in the future.

Message Edited by aucci on 09-28-2007 01:49 PM

0 Kudos
Message 5 of 5
(3,301 Views)