Using a TestStand Environments File

Publish Date: Nov 22, 2017 | 0 Ratings | 0.00 out of 5 | Print | Submit your review


TestStand environments enable two or more TestStand system configurations to exist side-by-side on a single system. In this tutorial, we will look at using environments to control TestStand types, station globals, and station model capabilities.

Table of Contents

  1. Requirements
  2. TestStand Environments Demo
  3. Creating a .tsenv File
  4. Additional Resources

1. Requirements

  • TestStand 2016 or later


Back to Top

2. TestStand Environments Demo

  1. Download the attached .zip file, which contains a .tsenv file and three directories.
  2. Open the TestStand Sequence Editor. Notice that the default environment is <Global> in the status bar:

  1.  On the toolbar, navigate to Configure>>Environment. 
  2. In the Configure Environment dialog, browse to the DemoEnvironment.tsenv file. The dialog should populate with the custom directories. For more information on the dialog box, see Teststand Help: Configure Environment Dialog Box.

  1. Click Set Engine Environment. This will exit and relaunch the Sequence Editor in the new environment.
  2. The status bar will now display “Environment: DemoEnvironment.tsenv.” Notice that the station model is different for this environment.  It is now ParallelModel.seq.

  1. The demo environment has its own type palette. Navigate to MyTypes.ini the types palette. Notice that under Step Types and Custom Data Types, there are two different types called “CustomDemoStepType” and “CustomDemoDataType” respectively.

Note that the owning type palette is MyTypes.ini. Hover over MyTypes.ini, and you can see that the file is contained in DemoPublic, the TestStand public directory for the demo environment:

  1. In the Variables Pane, expand StationGlobals. There will be an addition station global “DemoEnvironmentSG”:

  1. Launch another instance of the Sequence Editor. The default behavior is to launch with the <Global> environment. Compare the station globals and the types in My_Types.ini. Notice how CustomDemoStepType, CustomDemoDataType and the DemoEnvironmentSG station global are not in the <Global> environment.

This section demonstrated the basics of a TestStand environment and a use-case for it. You can build from this demo, or create an environment from scratch. The following section will show how to create a custom TestStand environment. 

Back to Top

3. Creating a .tsenv File

A .tsenv file defines a TestStand environment. It is an INI text file that can specify the TestStand Public directory, TestStand Application  (CommonAppData) directory (which implicitly defines the TestStand Configuration directory), and/or the TestStand Local Application (LocalAppData) directory. For more information, see TestStand Help: TestStand Environments.

There are two methods to create a TestStand environment. The first method is to create the file manually using a text editor, and the latter is to use the Sequence Editor to create the .tsenv file. 

Creating .tsenv From a Text Editor

  1. Create a .tsenv file by creating a text file and changing the extension to .tsenv. In this tutorial, a DemoEnv.tsenv file has been created at C:\Users\Public\Environment\DemoEnvironment.tsenv. Note: Ensure that you can see the extension of your file to guarantee that the file’s extension has been changed.
  2.  Insert the following section and keys:

    CommonAppData = "EnvironmentRoot\\DemoCommonAppData"
    LocalAppData = "EnvironmentRoot\\DemoLocalAppData"
    Public = " EnvironmentRoot\\DemoTestStandPublic"

    The paths can be absolute or relative to the environment root directory. The paths shown here are relative to the directory of the .tsenv file. For deployment of your TestStand system, the paths to each folder must be relative.

    Note: You do not have to specify all the of the folders. If you wish to share a default folder of the TestStand Global Environment, omit the key or set it to an empty string.  
  3. Load the Environment file into TestStand. In the sequence editor, go to Configuration>>Environment. Click on “…” and browse to your environment file.
  4. When your file has loaded, ensure that the folders that you wish to map your environment to appear as intended. Click Set Engine Environment to relaunch TestStand in the new environment.

Creating .tsenv from TestStand 

  1. Navigate to Configure>>Environment. In the Environment Path text box, replace “<Global>” with an absolute path to an environment file such as “C:\Users\Public\Environment\DemoEnv.tsenv” and click Save. TestStand will create a DemoEnv.tsenv file in the location specified.
  2. In the Custom Directories tab, check any directory and enter a name for the folder. If there is a folder on disk that you want to use, then you can click on “…” and browse to that folder. Click Save to save the environment file.
  3. Click Set Engine Environment to load this new environment file and to personalize your environment. TestStand will create any missing custom folders and populate them with the default configuration files as necessary.

Back to Top

4. Additional Resources


Back to Top

Bookmark & Share




Rate this document

Answered Your Question?
Yes No