How Can I Skip a Step in TestStand If a Previous Step Has Failed?

Updated Jan 30, 2018

Reported In

Software

  • TestStand

Issue Details

  • I have a step in my sequence that should be skipped if any of the previous steps have failed.
  • I tried to use RunState.ThisContext.SequenceFailed in my step's Precondition Expression, but that property does not equal true even if a previous step has failed.

Solution

  • If you have multiple sub-sequences, RunState.ThisContext.SequenceFailed will not equal true unless a step specifically fails in the currently executing sub-sequence.
  • A potential solution is to use the SequenceFilePostStepFailure callback in your sequence file and set a boolean File Global variable to true in there. Then you can determine if any step has failed in any sequence file sequence by reading that value. If you are using either a step's Precondition Expression or an If step, your expression can be !FileGlobals.MyFailBoolean to skip the step or skip the If.