TestStand 2019 Help
»View Product Info
To display the .NET Module tab in the TestStand Sequence Editor, insert a step configured to use the .NET Adapter and select Specify Module or Step Settings from the context menu. The .NET Module tab contains the following options:
- Assembly—The absolute or relative file path or strong name of the assembly the step calls, or the strong name of the assembly if the assembly is in the Global Assembly Cache (GAC). Relative pathnames are relative to the TestStand search directory paths. Use the Edit Search Directories dialog box to customize the search directory paths. For assembly files, the Assembly ring control contains a most recently used list of the last five assemblies selected.
- Browse for Assembly—Launches a Browse dialog box in which you can specify a pathname for the assembly.
- Browse the GAC—Shows a list of assemblies registered in the GAC.
- Advanced Settings—Launches the Advanced Settings window, in you can control the lifetime of an object the .NET step creates.
- Reload Assemblies and Prototypes—The .NET Adapter reloads the information about classes, methods, and properties in the assembly for each specified call and updates the prototype specified for the calls, if needed.
- Root Class—The name of the class on which the first call in a chain of calls for the step operates. When you select an assembly, the .NET Adapter populates this control with a list of classes defined for the assembly. Any fully-specified generic types referenced in the assembly will also appear at the bottom of this list.
- Edit Code—Launches Microsoft Visual Studio to edit the code for a call currently selected in the .NET Invocation control. If you have not specified a project or source file in the .NET Source Code Files window, TestStand launches an Open File dialog box and prompts you to browse for the files. Because you can specify Edit Code operations for multiple calls in a single step, the project file you select applies to any other calls you make in the same step, but you must specify a new source file for each individual call.
||Note You must have a supported version of Visual Studio installed and the currently selected call in the .NET Invocation control must be fully specified and valid for you to use the Edit Code button.
- Create Code—Launches Visual Studio to create a shell function by using the member name of the call currently selected in the .NET Invocation control as the name of the method to create and the class name of the call as the class in which to create the function. If you have not specified a project or source file in the .NET Source Code Files window, TestStand launches an Open File dialog box and prompts you to browse for the files. Because you can specify Create Code operations for multiple calls in a single step, the project file you select applies to any other calls you make in the same step, but you must specify a new source file for each individual call.
||Note You must have a supported version of Visual Studio installed and a call with a valid class name currently selected in the .NET Invocation control to use the Create Code button.
The .NET Adapter appends the newly created function to the end of the source file you select in the .NET Source Code Files window. If a code template file exists for the step type you use for the step, the adapter uses the template to create the shell for the new function. If the project file you specify in the .NET Source Code Files window is not in the Visual Studio solution, the adapter prompts you to add it. If the source file you specify in the .NET Source Code Files window is not in the project, the adapter prompts you to add it. If you already have the source code for the function, click the Edit Code button instead to edit the code associated with the call currently selected in the .NET Invocation control.
If template source code exists for the step type you use for the step, the .NET Adapter inserts the parameter information from the template source code into the new function shell. If the step type does not have a code template, TestStand uses the default template for the adapter.
When the .NET Adapter creates the code, the adapter launches a copy of Visual Studio and displays the file in Visual Studio.
- .NET Source Code Files—Launches the .NET Source Code Files window, in which you can specify the pathname for the source file, project file, and solution file for Visual Studio that implement the functions the code module calls. You must have a supported version of Visual Studio installed to launch the .NET Source Code Files window.
- .NET Invocation—The chain of calls the step completes at run time. Right-click, double-click, or press <Ctrl-Space> to show the list of members available to call. Select a member name in the list of members or type the member name to specify it. Press <Enter> or <Tab> to insert the call currently selected in the member list into the .NET Invocation control. Enter a period (.) character or click the <Click here to add a call> text to show a list of members available for the next call.
After you specify the calls, the .NET Invocation control shows the signatures of each call in the chain of calls. TestStand shows in red calls you incorrectly or partially specify. Parameters that contain invalid values or required parameters that you have not yet specified display in red even if the call is valid.
Click anywhere on a call signature to select the call and view or edit its parameters in the Parameters Table. TestStand shows the currently selected call in bold in the .NET Invocation control. Click a particular parameter in the signature to highlight the parameter in the Parameters Table. TestStand shows the selected parameter in bold in the .NET Invocation control.
For the first call in the chain you specify in the .NET Invocation control, the member list shows only constructors, static members, and the following special case call types:
- Use Existing Object—Use this call type to specify an existing object to use instead of calling a constructor. The Parameters Table for this call contains an Existing Object parameter for you to specify. You must specify a valid TestStand object reference variable or basic type variable (in the case of the System.String type, System.Int32 type, or other basic types) that refers to the object on which to perform the next call. If you specify a struct instead of a class for the root class of the step, you can also specify an instance of a TestStand custom data type that corresponds to the struct instead of a TestStand object reference variable because a struct is a .NET value type, and a class is a .NET reference type.
Click the Create Type from Struct button in the Parameters Table to launch the Create Custom Data Type from Struct dialog box and create a named data type. If you specify an instance of a named data type, the .NET Adapter creates a temporary .NET struct and copies the corresponding fields between the struct and the TestStand variable.
- Create Remote Object—Use this call type to retrieve a .NET object using .NET remoting. The Parameters Table for this call contains a Remote URI parameter for you to specify the universal remote identifier (URI) of the server and an optional return value that specifies a TestStand object reference variable to store the object.
For subsequent calls in the chain you specify in the .NET Invocation control, the member list shows the instance members of the class that corresponds to the return value of the previous call.
||Note Hover your cursor over a member name in the .NET Invocation control to view any XML help that has been defined for that member.
- Parameters Table—Contains the parameters and return values for all calls in the step. The Parameters Table lists parameters for each call under a row that displays the member name for the call. The Parameters Table contains the following columns:
- Parameter Name—The name of the parameter. For properties and fields, the Parameter Name column contains a combo box you can use to switch between GetProperty and SetProperty. If a public version of a Get or Set does not exist for the property or field, the combo box does not include the option.
||Note Parameters with attributes include an Edit Attributes button in the Name column of the Parameters Table. You can edit attributes for fields of structs and elements of arrays. TestStand associates parameter attributes with the module parameter, which TestStand stores with the step configuration information and not with the parameter value that TestStand passes to the module. Right-click an item in the Parameters Table to and select Edit Attributes from the Parameters Table context menu to launch the Attributes dialog box.
- Type—.NET data type for the parameter.
For one-dimensional arrays, you can specify an expression value for the entire array, or you can specify values for each element of the array. Use the plus (+) buttons to insert a new element in the array, and the minus (-) buttons to remove specific elements from the array.
- Create Type from Struct—If the data type is a struct, such as a .NET value type, this button appears in the cell and launches the Create Custom Data Type from Struct dialog box, in which you can configure a new custom data type to use as the variable type for passing the struct parameter.
- In/Out—Indicates whether the parameter is an input, output, or both.
- Log—When you enable this option, the step logs the parameter as an additional result. Enabling this option is equivalent to using the checkbox next to the additional result name on the Additional Results panel of the Properties tab of the Step Settings pane. For in/out parameters, enabling this option enables the [In] parameter and the [Out] parameter on the Additional Results panel. This option is indeterminate for in/out parameters if you specify to log only the [In] parameter value or only the [Out] parameter value. If this option is indeterminate, a tooltip specifies whether the Additional Results panel specifies to log the [In] parameter value or the [Out] parameter value.
- Dispose—When you enable this option, TestStand calls the Dispose method on the .NET object when the output parameter references are released. If the object does not implement the IDisposable interface, this option is ignored.
- Use Default Value—When you enable this option, TestStand uses the default value of the parameter. An option appears in this column only for parameters that have default values.
- Value—A TestStand expression. For input parameters, TestStand passes the value of this expression. For output parameters, TestStand stores the data the method returns in the location this expression specifies. To help you enter an expression in the Value column, click the Expression Browse button to launch the Expression Browser dialog box. For enumerated types, a combo box displays all valid values for the type. You can also use an expression for an enumerated type. Refer to the .NET Call Parameters topic for more information about using enumeration parameters.
In addition, you can store all .NET types directly in a TestStand object reference variable, which is useful when you want to store a .NET array without making a copy and do not need to access the array directly from TestStand.
.NET Code Module Support for 64-bit TestStand
Advanced Settings Window
AnyCPU Assemblies in 32-bit TestStand and 64-bit TestStand
Attributes dialog box
Create Custom Data Type from Struct Dialog box
Edit Search Directories dialog box
Expression Browser dialog box
.NET Source Code Files Window
Parameters Table Context Menu for Module Tabs
Platform-Specific Assemblies in 32-bit TestStand and 64-bit TestStand
Step Settings Pane
Using the $(Platform) Path Macro to Locate the Correct Code Module in 32-bit TestStand and 64-bit TestStand