Creating a .NET Event When TestStand Steps Start or Finish

Updated Mar 28, 2018

Reported In

Software

  • TestStand

Issue Details

I want to create an event for each sequence step's execution using TestStand's .NET API to track the sequence's execution and determine when each step starts and completes.  What are the API calls to do this? 

Solution

If you want to log an event, you can accomplish this by sending a UI Message from an Engine Callback.  There are two different callbacks to modify to register an event.  

To register an event before a step executes: 
  • Override the SequenceFilePreStep engine callback and add a Statement step to the Main sequence. 
  • Populate the Statement Step with the following syntax:  RunState.Thread.PostUIMessageEx() 
    • Modify the arguments to the RunState.Thread.PostUIMessageEx() function to suit your application.
Creating an event after a step executes is a very similar process:
  • Override the SequenceFilePostStep engine callback and add a Statement step to the Main sequence. 
  • Populate the Statement Step with the following syntax:  RunState.Thread.PostUIMessageEx() 
    • Modify the arguments to the RunState.Thread.PostUIMessageEx() as necessary.

Additional Information

These modifications will add overhead to your sequence execution, so you will likely see an increase in overall test times with these additions. 

WAS THIS ARTICLE HELPFUL?

Not Helpful