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

Updated Oct 22, 2025

Environment

Software

  • TestStand

When an error occurs in a step during a sequence, TestStand pops up a Run-Time Error dialog box as the default behavior. If you change the On Run-Time Error option in the Execution tab of the Station Options to Ignore , the execution 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. Open the Sequences Pane if not visible (View >> Sequence File >> Sequences).
  3. Right Click On the Sequences Pane and select Sequence File Callbacks... from the shortcut menu.
  4. Select the SequenceFilePostStepRuntimeError engine callback from the list.
  5. Click OK. TestStand should select the newly added callback automatically for you.
  6. On the Steps Pane of the SequenceFilePostStepRuntimeError, insert a statement step, and set its expression to #NoValidation(RunState.Caller.RunState.SequenceFailed = True).

The screenshot below shows what the callback should look like.

callback implemented

This expression allows you to set the Caller's (which is MainSequence) SequenceFailed property to True, and your sequence will now be marked as Failed.

In the ErrorToFail.seq example, we have a Pass/Fail Test step (None Adapter) that is forced to Pass, and a Multiple Numeric Limit Test (None Adapter) that we know will throw an error at run time. In that scenario, the expected behavior is the sequence to return an Error status, but since we've implemented the SequenceFilePostStepRuntimeError engine callback, it will return a Failed status instead.

Example Sequence File

You can easily check the test status by hovering your mouse over the execution tab. 

Sequence with Failed Status 

 

Next Steps

If you want to try the example, download and run the ErrorToFail.seq sequence file, developed for TestStand 2019 or later. We suggest you to use the Run MainSequence execution entry point.

Attachments