How Can I Output TestStand Report Result as JSON?

Updated Mar 19, 2025

Reported In

Software

  • TestStand

Issue Details

I would like to configure TestStand to output execution results in JSON but by default TestStand only supports ASCII plain text and XML formats and I could not find any way to convert these output to JSON format.

 

How can I configure TestStand to output test result as JSON?

Solution

The execution results for the steps in a sequence are captured in the array of Result, Locals.ResultList. The information contained in this result array can be converted into JSON data by following the below steps:

1.Open the sequence whose results you want to convert to JSON.

2. Put a breakpoint at the end of the sequence, i.e. at the “<End Group>” marker of the “Cleanup” group.

3. Execute the sequence with or without a process model.

4.When the execution pauses at the above breakpoint, add the following expression in the Watch View:

Locals.ResultList.GetFormattedValue(“”, 0x1001)

5. The value of this expression is the JSON equivalent of the sequence execution result.

6. Right click on this expression and select “Copy Value” to copy the JSON data into the clipboard.

Additional Information

In order to automate the creation of the JSON formatted results, on can follow one of the below solutions:

  1. Creating a custom step type with a Post-Step Substep configured to run a code module that creates a file and writes the JSON data. The file path and the JSON data can be passed as arguments to this Post-Step Substep code module from this custom step type.
  2. Creating custom result processor plugins for TestStand and utilize this hidden option for PropertyObject to create JSON formatted sequence execution results.