Exclude Passed Steps in a TestStand Report

Updated Nov 15, 2024

Environment

Software

  • TestStand

This article describes three methods to configure a TestStand Sequence to record step results in the report only when the step has failed.

 

Depending on your requirements, each method has a slightly different use case:

 

  1. Configure Results Processing - excludes all Passed, Done and Skipped results from a report.
  2. Using a Callback - discards all step results with a specific status.
  3. Using a Statement for One Step - discards the results for one specific step.

Configuring Results Processing

This option can be used if you wish to exclude all Passed, Done and Skipped steps from your report.

 

Implementation

Follow the steps below to implement this method:

  1. In TestStand, select Configure >> Results Processing.

 

Results Procesing.PNG

 

  1. In the pop-up window, select the wrench icon on the Report row.

 

Wrench icon.PNG

 

  1. In the Report Options window, set Result Filtering Expression to Exclude Passed/Done/Skipped.

 

Exclude passed done kipped.PNG

 

  1. Click OK twice to close all windows.

 

Result

Consider the TestStand sequence below. It consists of six Pass/Fail Tests: three are configured to Pass and three are configured to Fail.

 

PassFail Example.PNG

 

 

 By setting a filter on the Results Processing, the TestStand report will only show the step with a Failed status.

 

Report 1.PNG

 

Using a Callback

This method involves using the SequenceFilePostResultListEntry Engine Callback to discard results based on a particular status. This can be used in a scenario where all Passed results should be omitted, but Done, Skipped and Failed should be included.

 

Implementation

Follow the steps below to implement this method:

  1. From the right-hand side, select the Sequences pane.

 

Sequences pane.PNG

 

  1. Right-click on some empty space and click Sequence File Callbacks...

 

Sequence file callbacks.PNG

 

  1. In the pop-up window, place a checkmark in the SequenceFilePostResultListEntry Callback.

 

SequenceFilePostResultListEntry Callback.PNG

 

  1. Click OK to close the window.
  2. Insert a Statement Step into the Callback.

 

Statement in Callback.PNG

 

  1. Enter the following Expression into the Statement step:
    • Parameters.DiscardResult = (Parameters.Step.Result.Status == "Passed") 

 

Expression in Statement.PNG

 

Result

Consider the TestStand Sequence below. It consists of five steps:

  • Pass/Fail Test 1 configured to pass.
  • Pass/Fail Test 2 configured to be skipped.
  • Pass/Fail Test 3 configured to pass.
  • Action step.
  • Pass/Fail Test 4 configured to fail.

 

Callback main equence.PNG

 

 

With the SequenceFilePostResultListEntry Callback, the report exclude only Passed steps.

 

Report 2.PNG

 

Using a Statement for One Step

This method uses a Statement to evaluate the status of one step. This option can be used if you do not wish to configure a rule for the entire sequence, and only want to exclude a single step.

 

Implementation

Follow the steps below to implement this method:

  1. From the Variables pane, create a new Number variable called index.
    • This variable will be used to store the number of results currently stored in the ResultList array.

 

index variable.PNG

 

  1. Underneath the Pass/Fail Test step that you wish to evaluate, place a Statement step.

 

Added Statement step.PNG

 

  1. On the Properties tab of the Statement step, select the Preconditions tab.
  2. Set the Precondition to RunState.PreviousStep.Result.Status == "Passed"
    • This ensures that the Statement step only runs if the previous step (Pass/Fail Test step) passed.

 

Precondition.PNG

 

 

  1. On the Expressions tab set the Pre-Expression to Locals.index = GetNumElements(Locals.ResultList) -1
    • This obtains the number of results currently stored in ResultList and stores this value in the index variable.

 

Pre Expression.PNG

 

 

  1. Set the Post-Expression to RemoveElements(Locals.ResultList,"["+ Str(Locals.index) + "]",1)
    • This removes the previous result from ResultList, which corresponds to the Pass/Fail Test step prior.

 

Post Expression.PNG

 

 

Result

Consider the below TestStand Sequence. It consists of 3 steps:

  1. A Message Popup, which prompts the user to select whether the Pass/Fail Test step should pass or fail.
  2. A Pass/Fail Test step, which passes or fails based on the selection above.
  3. A Statement step, which deleted the Pass/Fail Test step results from the report if it passed.

 

MainSequence.PNG

 

If the Pass/Fail Test step fails, the report appears as follows:

 

Failed report.PNG

 

If the Pass/Fail Test step passes, the report appears as follows:

 

Passed report.PNG