Calling Scripting Languages from TestStand
- Updated2025-07-21
- 3 minute(s) read
Calling Scripting Languages from TestStand
A scripting language is a programming language you can use to control one or more software applications. Typically, the core code of an application and the scripts are written in different languages, and the end user is often responsible for creating or modifying the scripts. Scripting languages include the following distinctive features:
- You do not compile a scripting language into an executable. An interpreter converts a scripting language from source code to native computer code at run time.
- Scripting languages can use variables to hold any type of data without explicitly declaring a data type.
- Scripting languages can natively provide some complex data types, such as strings, arrays, lists, and hash functions.
- Scripting languages can automate garbage collection to reduce the chance of memory leaks occurring.
You can use the Call Executable step type in TestStand to call a scripting language, such as Python or Perl, using any of the following methods:
- Specifying the script file as the file to execute
- Configuring the standard input text or file to pass to the executable call
- Configuring the file or variable to retrieve standard output and error
- Specifying the working directory
You can use the File Pathname control on the Call Settings tab of the Call Executable edit tab on the Step Settings pane to specify the name of a file to open using the default application associated with the extension of the file. For example, you can launch a .bat file or open a .txt file by specifying the non-executable file directly. You can also use expressions to specify the path to the file.
You must configure the step to wait for the specified executable call to exit or wait for a specified time to enable access to the options you use to specify standard input to pass to the call and to specify how to retrieve standard output and standard error from the call.
You can configure the step to stream a file as input or evaluate a string or an expression as input. You can store the output and error information in a file on the local computer or on the remote computer when you call the executable on a remote computer. TestStand overwrites the file if it already exists. Alternatively, you can use an expression to store the output and error information in a TestStand variable or property, and you can use the status expression of the step to evaluate the output value. You can configure the step to ignore or set the step status to Error or Failed when the executable you call returns an error. You can include error information in the report TestStand generates.
You can specify the working directory for the executable by configuring TestStand to use the file directory, the sequence file directory, the current directory for the process, or an absolute path. You can also use expressions to determine the working directory at run time.
Refer to the following TestStand support documents on the National Instruments website for more information about calling scripting languages in TestStand: