How Do the Search Directories in TestStand Work?

Updated Dec 7, 2023

Reported In

Software

  • TestStand

Issue Details

Every time I specify a code module for a Test or Action step, it asks me to select if I want to include the file's path as absolute, relative or its directory added. How do I know which one to choose?
 

Solution

When including a code module or other sequence file as part of your sequence execution in TestStand, the application will ask you to add the file's path as an absolute path, a relative path, or add its path to the list of Search Directories. There are benefits and drawbacks to each of the selection for finding files and below is a summary of what these mean and why you would choose one of them.
  • Add to Search Directories - This selection adds the directory where your file is located to the list of Search Directories. When a file cannot be found in a specific directory, it will be searched along other directories specified in list of Search Directories, and you have the option of specifying whether to search within its subdirectories for files as well. Note that a particular directory must reside in the list of Search Directories first before it can be used as a relative path.
  • Absolute Path - This selection specifies that you want the exact path of the file to be used as a reference. With this, the file will not be searched within the list of directories from the Search Directories. If you move the file after choosing this selection, the file will not be found and you would need to specify the location of the new path.
  • Relative Path - This selection specifies that the file's path is relative to a current search directory that has already been specified in the Search Directories. With this, a shortened path is used to find the file that is referenced to the associated search directory. This selection allows you to move the file to other directories that are still relative to the search directories, but there will be some added overhead from searching if the file is not located in its original location.

Additional Information

For information on how to modify the list of search directories, how to add a new directory to the list, or the order of precedence of search directories, refer to the Search Directories - NI TestStand Help .
The location of the search directories depends on what version of Teststand you are using. In 2014 and earlier the search directories are stored in TestExec.ini.  In 2016 and later they are stored in SearchDirectories.cfg.
The deployment utility does use the search directories.  Basically if you can't run your sequence file in TestStand then there's a chance it won't deploy correctly.
You can reset to default search directories by deleting either TestExec.ini (2014 and earlier) or SearchDirectories.cfg (2016 and later). Then restart TestStand, it will create a new one of these files. Also keep in mind that the TestStand.ini file stores more settings besides the directories, which you may loose doing the aforementioned action.