This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

How to Dynamically Change the Report Directory in TestStand

Updated Oct 27, 2022



  • TestStand

How can I dynamically change the report directory in TestStand depending on either which client sequence file is currently executing, or on the value of a variable?

In order to change the report directory, you can overriding the ReportOptions callback in your test sequence and use a Statement step to set the following parameters.

Parameters.ReportOptions.Directory = <your custom directory>
Parameters.ReportOptions.DirectoryType = "SpecificDirectory"

Replace <your custom directory> with your target directory.

To switch the destination directory based on a variable, put a conditional statement before setting the directory, as demonstrated below.

Additional Information

Depending on your specific situation, you can add this code in two different places:
If you wanted to save the report to the directory containing your client sequence file, you get the path of the client file from the RunState.Root.RunState.ProcessModelClient.Path variable. Note that this variable is only available at runtime.

Attached is an example file which demonstrates modifying the report directory using the ReportOptions callback sequence.