Retry Step Based on Specific Error TestStand

Updated Jun 13, 2018

Reported In


  • TestStand

Issue Details

How can I automatically retry a step in TestStand based on a specific error code? 


They best way to change how TestStand interacts with all steps is through various Callbacks. The SequenceFilePostStepRuntimeError engine callback is the one that will allow access to how TestStand deals with the error from any given step. To add this the project sequence file follow the below steps. 


  1. Edit>Sequence File Callbacks
  2. Select SequenceFilePostStepRuntimeError and click Add then OK

Once added to the .seq file the callback will show as a red subsequence and any steps that are added to this subsequence will overwrite the process model allowing full customisation of TestStand. The functionality of retrying the step with a specific error can be seen created using the following steps within the SequenceFilePostStepRuntimeError callback or by downloading the attached file. 

  1. Create an If statement to filter out the specific error that you are looking for. The condition must be as follows Parameters.Step.Result.Error.Code == [INSERT ERROR CODE]
  2. Create a Statement Step that will suppress the default dialog box. The expression should be Parameters.Step.Result.Error.Occurred = False
  3. Create a Statement Step that will set the next step to be the one that just had the error. The expression should be RunState.Caller.RunState.NextStepIndex = RunState.Caller.RunState.StepIndex