How to Enable Step Result Recording in Case of Step Fail in TestStand?

Updated Jun 5, 2023

Environment

Software

  • TestStand

As part of my test program developed using TestStand I have a couple of steps which result recording are disabled by default (when step passes). However, in case of step fail I want to enable step result recording. But, how to do that?

A possible suggestion is to use the SequenceFilePostResultListEntry Engine callback, using it you can discard results based on status. To add this engine callback:

  • Select Edit » Sequence File Callbacks to launch the Sequence File Callbacks dialog box. 
  • Select SequenceFilePostResultListEntry and press Add in order to add it to the client sequence file, and then press OK to close the dialogue box. This callback is empty by default, but you can use it to alter/manipulate the ResultList after every sequence step that logs a result.
  • After adding the callback, use a statement step with the following expression:

Parameters.DiscardResult = (Parameters.Step.Result.Status == "Passed") 

The following image shows the generated report from a particular sequence using this approach: 

Refer to the sequence file PassedResults.seq for an example of how to filter the results in the generated report. The below image shows the SequneceFilePostResultListEntry Engine Callback: