NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Name of the first failed sequence

Hi,

 

Teststand newbie here. Got stuck at a seemingly trivial issue. Experimenting on a small example (atttached here) but actual application has over 250 sub-sequences. 

 

Got a MainSequence that has 2 sub-sequence Seq 1 and Seq 2. Each of the sub-sequence has 3 numeric limit tests (1a, 1b, 1c) and (2a, 2b, 2c).

So, trying to get the NAME of the FIRST step failed and corresponding NAME of the FIRST Sequence to print on a label for production. So, e.g. "TEST FAILED: 1c, Seq 1".  The test is supposed to continue till the end, even on failure. 

 

NAME of the FIRST step failed (SOLVED):

Defined two globals and was able to get the NAME of the first step failed by adding SequenceFilePostStepFailure callback and adding the following expression:-

FileGlobals.FirstFailedStep = Parameters.Step.Name, FileGlobals.FirstFailFlag = True

-------------------------------

NAME of the FIRST sequence failed (UNSOLVED)

Test stand report finds this so I am pretty sure it exists someway.

 

Capture.PNG

 

1 solution I found was following:-

 

Defining another global and adding this condition to EACH sequence 

If (RunState.SequenceFailed==True)
FileGlobals.FirstFailedSeq = NameOf(RunState.Sequence)
End

 

ISSUES:-

1. FirstFailedSeq variable gets updated with the last failed sequence. Older ones are over-ridden. Works when I set post actions for the sequence to go to cleanup on failure. Defeats the purpose of the test objective. 

2. Need to add this to all the Sequences. Insane amount of work to add it to all 250 sub-sequence. 

 

Attached the .seq file for reference. 

 

Any way to get the expression all the way to top-level to get the first failure?

Any standard or best practice for first step solution?

 

-----Edited the post with the correct .seq file

0 Kudos
Message 1 of 1
(1,549 Views)