NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Capture failing step of a sequence

I wanted to capture the failing step for entry into a CSV report. I was having trouble doing it and wanted to share what I arrived at. This simple solution works for me.

 

1. Create empty string array "StationGlobals.sequence_failure_chain".

2. Add sequence file callback SequenceFilePostStepFailure.

3. Insert statement into SequenceFilePostStepFailure saving the failing step name: "StationGlobals.sequence_failure_chain += { Parameters.Step.Name }".

4. Use the array entry you want for step failure as an input to the CSV file.

Download All
Message 1 of 3
(2,549 Views)

This is great if you are only 1 sequence file deep.  If you are calling other sequence files you need to put this callback in all of them.  Then you need a way to propagate it back up to all the callers. Nevermind...just saw the stationglobals statement.

 

One way to get around that is to put ProcessModelPostStepFailure callback in your process model and place the same code you have.  However, now you have to customize the process model which means you need to maintain it.

 

Another thing to note is that this can capture many failure chains if you continue on fail.  Which is fine if that's the behavior you want.

 

Thanks for sharing!

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

I typically go to cleanup on a failing step, so the multiple entries are fine. I can just take the last one.

 

If a subsequence fails and the array is of the form:

{ "failing step name from subsequence", "subsequence name" }

I now have the option of passing the first element to the CSV step. That just seems more descriptive to me. Our repair people need to know why something failed.

 

 

 

 

 

0 Kudos
Message 3 of 3
(2,516 Views)