How to Dynamically Change the Report Directory in TestStand

Updated Jan 8, 2019

Reported In


  • TestStand

Issue Details

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 set the following ReportOptions variables:

Parameters.ReportOptions.Directory = "custom directory"
Parameters.ReportOptions.DirectoryType = "SpecificDirectory"

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 have many client sequence files, you may want to modify the process model so that each one can use the same code. For instance, if you are using the sequential model, add the above code to the Get Report Options sequence. Remember, if you are using one of the built in process models, copy the file into the user directory to preserve the original. 
  • If you have just a few client sequence files, override the ReportOptions callback in each one and add the above code.

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.


Not Helpful