Purpose

This example demonstrates how to use Message Popup steps to obtain user input using the following two methods:

  • Using Buttons
  • Using a Text Field

The example determines what actions to take based on user selections.

Example File Location

<TestStand Public>\Examples\Built-In Step Types\Message Popup Step Type\Message Popup Step Type - Get User Input.seq

Highlighted Features

  • Case steps
  • Error handling
  • Message Popup steps
  • Preconditions
  • Select steps

Major API

None

Prerequisites

None

How to Use This Example

Complete the following steps to review the steps in the Buttons sequence. This sequence demonstrates how you can use a message popup step to prompt a user for input using buttons.

  1. Select the Board Test Selection – Buttons step. In the Step Settings pane, select the Text and Buttons tab.
  2. Observe that the button names are specified in the Button 1 through Button 5 fields. The message popup step will display all buttons with specified names.
  3. The example uses a Select statement to respond to the user selection. The Select statement accesses the RunState.Sequence.Main["Board Test Selection - Buttons"].Result.ButtonHit property to check the button the user chooses.

Complete the following steps to review the steps in the PromptForInput sequence. This sequence demonstrates how you can use a message popup step to prompt a user for input using a response text box.

  1. Select the Select Board to Test - Text Field step. In the Step Settings pane, select the Options tab.
  2. Observe that the Enable Response Text Box option is enabled. This option adds a response text box to the message popup to receive user input.
  3. The example uses a Select statement to respond to the user selection. The Select statement uses the expression Val(RunState.Sequence.Main["Select Board To Test - Text Field"].Result.Response) to check the response the user enters.
  4. If an invalid value is entered, the default case notifies the user of the response. This step triggers a post action, in which the Select Board To Test - Text Field step executes again to allow the user to enter a valid response.
    Note The Val() expression function converts the text response string to a number.

Complete the following steps to run the example:

  1. Select Execute»Single Pass to run the sequence.
  2. When prompted, click a button or enter a value. Notice that the sequence responds differently based on the input you provide.