Producing a Fail Result for a Sequence when Step has Runtime Errors

Updated Jun 24, 2021

Environment

Software

  • TestStand

When an error occurs in a step during a sequence, TestStand pops up a Run-Time Error dialog box. By default, choosing to Ignore the run-time error will produce a "Pass" result for the sequence when all other steps in the sequence have passed.

How can I have TestStand produce a "Fail" result when any step in a sequence has had a run-time error?

A Sequence Callback can be used to set the test result that TestStand provides when an error occurs during a step:
  1. Open the sequence file (.seq) in TestStand.
  2. In the main menu, select Edit»Sequence File Callbacks.
  3. Select SequenceFilePostStepRuntimeError from the list.
  4. Click Add, then click Edit. You will be taken to a new sequence in the same file.
  5. Insert a statement step, and set its expression to RunState.Caller.RunState.SequenceFailed = True.

Additional Information

This expression allows you to set the Caller's (which is MainSequence) SequenceFailed flag to TRUE, and that sequence will now be marked as "Failed".