How Do I Set the Default Response Value in a TestStand Message-Popup Step

Updated Feb 7, 2019

Reported In


  • TestStand 2012

Issue Details

In my TestStand sequence, I am using a Message Popup step to ask the user for some information. On the Options tab in the Configuration dialog box for this step, there is an Initial Response String control for the default response value. The default response value I want to display is stored in a string variable, but the "Initial Response String" control only allows a string constant and not expressions.

How can I specify an expression for the default response value?


The default response value of a Message Popup step is stored in one of the properties of the step named DefaultResponse. Therefore, the value of the Initial Response String control is stored in this property. If the default value you want to display is in a local variable (e.g. Locals.MyDefaultValue), it is possible to use a pre expression to set the value of the Step.DefaultResponse property to the value stored in your variable.

To use a pre expression to display the value of a variable as the default response value of a Message Popup:

  1. Double click on the Message Popup step to open its properties window.
  2. Switch to the Expressions tab and enter code similar to the following in the Pre Expression control:
    Step.DefaultResponse = Locals.MyDefaultValue
    Where Locals.MyDefaultValue is your variable containing the default response value you want to display.
  3. Click OK to close the properties window.


Additional Information

NOTE: for TestStand 2014 and later, expression statements are allowed in the Initial Response String control.


Not Helpful