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:
- In TestStand, select Configure >> Results Processing.
- In the pop-up window, select the wrench icon on the Report row.
- In the Report Options window, set Result Filtering Expression to Exclude Passed/Done/Skipped.
- 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.
By setting a filter on the Results Processing, the TestStand report will only show the step with a Failed status.
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:
- From the right-hand side, select the Sequences pane.
- Right-click on some empty space and click Sequence File Callbacks...
- In the pop-up window, place a checkmark in the SequenceFilePostResultListEntry Callback.
- Click OK to close the window.
- Insert a Statement Step into the Callback.
- Enter the following Expression into the Statement step:
- Parameters.DiscardResult = (Parameters.Step.Result.Status == "Passed")
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.
With the SequenceFilePostResultListEntry Callback, the report exclude only Passed steps.
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:
- 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.
- Underneath the Pass/Fail Test step that you wish to evaluate, place a Statement step.
- On the Properties tab of the Statement step, select the Preconditions tab.
- 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.
- 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.
- 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.
Result
Consider the below TestStand Sequence. It consists of 3 steps:
- A Message Popup, which prompts the user to select whether the Pass/Fail Test step should pass or fail.
- A Pass/Fail Test step, which passes or fails based on the selection above.
- A Statement step, which deleted the Pass/Fail Test step results from the report if it passed.
If the Pass/Fail Test step fails, the report appears as follows:
If the Pass/Fail Test step passes, the report appears as follows: