How Can I Record Which Button Was Pressed in a Message Popup Step in TestStand?

Updated Oct 24, 2020

Environment

Software

  • TestStand

I want to know which button a user pressed in a message popup step and save this to a local variable

To do this, go in to the Message Popup step Properties tab:
Go to the Post-Expression box in the Expressions settings:

Enter the following expression:
Locals.<variable name> = Locals. Local.GetNthSubPropertyName("",Step.Result.ButtonHit-1,0)
This will retrieve the name of the button that was pressed (Step.Result.ButtonHit) and save it in the specified local variable as a string.