How to Obtain Message Popup's User Input String in TestStand?

Updated Dec 26, 2024

Environment

Software

  • TestStand

TestStand comes with a built-in Message Popup step that enables the test program to interact with the test program user. This article will demonstrate how to use the built-in Message Popup step to obtain string input from the user, save it into a local variable, and display the response received by using another Message Popup step.

  1. Launch TestStand
  2. Create a new sequence file by File>>New>>Sequence File
    2024-12-25_13h08_28.png
  3.  In MainSequence, insert a Message Popup step.
  4. Assuming the current Message Popup is to obtain the serial number, insert the following text into the Message Expression of Step Settings' Text and Button tab
    "Please insert your Serial Number"

  5. Go to the Options tab and select Enable Response Text Box. This will enable the user to provide text-based input in the message popup.
  6. Create a string local variable by right click and select Insert Local>>String
    2024-12-25_13h04_26.png 
  7. The default name of a local variable is local. For demonstration in this article, the local variable will be named SerialNumber
  8. Below are two possible approaches to save the text response of the message popup into a local variable:
    • Method 1
      1. Go to Step Settings>>Properties>>Expressions of the Message Popup step
      2. Insert the following expression into the Post-Expression
    • Method 2
      1. Insert a Statement step after the Message Popup step
      2. Insert the following expression into Step Settings' Expression
  9. Insert a new Message Popup step into the MainSequence to show the serial number inserted in the previous Message Popup by using the following Message Expression in the new Message Popup step
    Locals.SerialNumber

  10. Run the MainSequence and observe that the user is now able to provide the serial number in the first message popup, and the second message popup will show the serial number provided
    (Both methods in Step 8 will show the exactly similar behavior)