When TestStand Error Occurs, Skip to Cleanup with no UI Popup

Updated Feb 5, 2026

Reported In

Software

  • TestStand

Issue Details

I have a TestStand sequence where I will occasionally get expected errors when communication drops between devices. When these errors occur, I would like the sequence to go to the cleanup steps immediately, and I would not like the error popup to occur.

Solution

There are two methods for suppressing the Run-Time Error dialog box:

 

 

  1. Modifying the Station Options - easier, but affects every sequence file you run on the station.
  2. Overriding the SequenceFilePostStepRunTimeError callback - More complex implementation, but affects only the current sequence file.

This article covers both approaches in detail.

 

 

Modifying the Station Options

 

TestStand allows you to define the execution behavior when a run-time error occurs, including not showing the error dialog. To achieve this:

 

  1. On the main menu, click Configure>>Station Options and select the Execution tab. 
  2. Set the On Run-Time Error dropdown selector to Run Cleanup. According to the TestStand Help, this option "Causes the execution to jump to the Cleanup step group. If the error propagates normally to the calling sequence, the calling sequence also jumps to the Cleanup step group so the cleanup steps run for all active sequences and the execution terminates."

     

     

    station options dialog

     

     

  3. Click OK to close the Station Options dialog.
  4. Run your sequence and force the error to happen. You'll notice that the dialog no longer shows up, but the final test status is still Error. You can hover your mouse over the step status or sequence file tab of the Steps View pane to get the full error message.

     

    checking error message after execution finishes.

     

 

Overriding the SequenceFilePostStepRunTimeError

 

This approach allows you to programmatically determine what to do when a step fails. You can not only suppress the run-time error dialog, but could display your custom error dialog, or even log that error to disk in a customized string format. Follow the steps below to hide the run-time error dialog and skip to cleanup:

 

  1. On the Sequences Pane, right click any blank area and select SequenceFileCallbacks... from the shortcut menu.
  2. Check the SequenceFilePostStepRuntimeError Engine Callback and click OK.
  3. Using Statement Steps, set the ErrorReported and GotoCleanup properties of the caller's sequence context to True.

     

    RunState.Caller.ErrorReported = True
    RunState.Caller.GotoCleanup = True

     

    statements implemented

     

  4. Run your sequence and force the error to happen. You'll notice that the dialog no longer shows up, but the final test status is still Error. You can hover your mouse over the step status or sequence file tab of the Steps View pane to get the full error message.

     

    checking error message after execution finishes.

     

Additional Information

Refer to the Using Callbacks in NI TestStand white paper to learn more about callbacks in TestStand.