Example Code

Deleting Results of Re-Executed Steps in TestStand

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Teststand

Code and Documents

Attachment

Overview

 By default, each step result in TestStand is logged in the report. In some cases, it's desirable to remove the results for any steps that have been repeated. This example demonstrates how to use engine callbacks to promp the user to retry a step, and conditionally include the results in the report.

Description

 This sequence uses the SequenceFilePostStepFailure Engine callback to prompt the user to choose whether to retry a step after a failure.  This engine callback executes after any test step fails, and includes parameters containing information about the step that failed.

 

In order to remove the results from the report, the example contains the SequenceFilePostResultListEntry callback, which is executed after any step adds data to the ResultList.  This callback includes a DiscardResult parameter.  If your callback code sets this property to true, the results for the step are not added to the ResultList and therefore not logged.

Hardware and Software Requirements

Removing Results for Re-Executed Steps - TS2012 - NI Verified

TestStand 2012 or Compatible

 Removing Results for Re-Executed Steps - TS4_2

TestStand 4.2.1 or Compatible

Steps to Implement or Execute Code

  1. Run the MainSequence sequence using Execute » Single Pass
  2. Observe that when the Pass/Fail test fails, the 'SequenceFilePostStepFailure' engine callback executes, prompting the user to retry the step or continue. Select to retry the step at least one time.
  3. Observe that the report contains only one instance of the repeated step
 
Al B.
Staff Software Engineer - TestStand
CTA/CLD

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors