NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable step result recording in case of step fail?

Solved!
Go to solution

Hi,

 

I have a couple of numeric limit test steps which result recording are disabled by default (when step passes). However, in case of step fail I want to enable step result recording but how to do that? Is it possible to do using SequenceFilePostStepFailure callback and programmatically enable there or how?

In other words, do not record step result if step passes, record if fails.

 

Br,

Jick

0 Kudos
Message 1 of 7
(3,950 Views)

One way that i have accomplished this before was to enable recording on the step. Once recording on the step is enabled, use a statement step below your numeric test to check the previous steps result by using RunState.PreviousStep.Result.Status == Pass. If the result is true then simply delete the last element out of Locals.ResultList. If it fails leave the entry it in the result list, which will then report it. During runtime, your report will look like it is capturing all the pass data, but once execution finishes and it compiles your report, all the passes should be gone!

 

I guess you could do something similar in the SequenceFilePostStepFailure by checking Step.Result.Status == Pass. However you will need delete the entry in Locals.ResultList entry from your caller and not in Post Step Failure Callback which could be a little bit trickier.

Message 2 of 7
(3,943 Views)

Attached is another example of how to accomplish this.  Using the SequenceFilePostResultListEntry you can discard results based on status.  In my example you will see that I check the step status for Passed.  If it it is Passed then I discard the result from ever getting put in the ResultList.

 

Cheers,

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

Thanks!

 

I will check these out. ~jiggawax~, could you save your example for TS version 2016, thanks!

 

Br,

Jick

0 Kudos
Message 4 of 7
(3,909 Views)

I am also struggling with the alright_meow's method. How do I remove the latest element from the ResultList? Attached an example of what I tried but it throws an error (Error in argument 2, '"[GetNumElements(Locals.ResultList)-1]"', in call to the expression function 'RemoveElements'.).

 

Br,

Jick

0 Kudos
Message 5 of 7
(3,897 Views)

Would result filtering not work for this?

ResultFiltering.PNG

-Trent

https://www.linkedin.com/in/trentweaver
Message 6 of 7
(3,886 Views)
Solution
Accepted by topic author Jick

I need this only for the specific steps and sequences but this is good to know, thanks.

 

I solved my problem using statement step after the step which needs result record skipping:

SetNumElements(Locals.ResultList,GetNumElements(Locals.ResultList)-1)

with precondition RunState.PreviousStep.Result.Status == "Passed"

 

Br,

Jick

0 Kudos
Message 7 of 7
(3,870 Views)