Changing TestStand Step Name Programmatically

Updated May 11, 2026

Reported In

Software

  • TestStand

Issue Details

When using TestStand and modifying a step’s name dynamically during execution does not appear to take effect immediately in the Execution view.  What is the correct approach that would allow the user to observe the change while the step is executing?

Solution

This behavior is expected in TestStand and is not a defect. A step cannot reliably modify its own name while it is executing, because Step.Name is evaluated and displayed by the Execution view only after the step completes, which is why changes made this way are visible only afterward. The supported mechanism for dynamically changing a step name at runtime is RunState.NextStep.Name, which applies the new name immediately to the step that is about to execute. However, even though RunState.NextStep.Name updates the step name internally at execution time, the Steps pane in the Execution view does not automatically refresh. As a result, the step name is updated but the UI may not change its value until a later refresh event occurs, such as when the step completes or execution pauses, creating the impression of a delayed update.
 
In order to change the step name and populate the change immediately the following steps can be followed:
 
  1. Create an Statement expression before the step name whose name needs to be edited.
  2. The go to the Step Settings for the Statement and add  RunState.NextStep.Name with the desired name.
  3. Then add a UI update event by using: RunState.Thread.PostUIMessageEx(UIMsg_RefreshWindows,0,"",RunState.Caller,True), as shown in the image below:
  4. Run the TestStand Sequence.

After running the sequence the step name will revert back into its original name.  This method only changes the name during execution period.