Variables Page

Applies to TestComplete 12.60, last modified on September 17, 2018

On the Variables page of the project and project suite editors, you can create, delete, or modify project and project suite variables. To open the page:

  1. Double-click the project or project suite item in the Project Explorer panel. TestComplete will open the project or project suite editor.

  2. In the editor, switch to the Variables tabbed page.

The image below shows the overall view of the Variables page of a project. The Variables page of a project suite looks the same:

Project - Variables page

Click the image to enlarge it.

The Variables page of the project editor shows variables of the project type, the Variables page of the project suite editor shows variables of the project suite type.

Depending on whether a variable value is stored between test runs or not, the Variables page has the following sections: Persistent Variables and Temporary Variables.

Each section lists variables of the appropriate type.

For each variable, the sections show the following information:

Column Description
Name Specifies the variable name.
Note: The variable name is used to address the variable in scripts, so it must match the naming rules of the scripting language you use. The names of project suite variables must conform to the naming rules of scripting languages in any project that belongs to the suite. The easiest way to do this is to follow this simple rule: the variable name must only consist of alphanumeric or underscore characters and it must start with a letter.
Type Specifies the type of the project or project suite variable.

The following types of variables are available in both the Persistent Variables and Temporary Variables sections:

  • Boolean - The variable can store Boolean values.
  • Double - The variable can store floating-point values and dates.
  • Integer - The variable can store integer values.
  • String - The variable can store string values.
  • Password - The variable can store string values and encrypt them.

Variables of the following types are available only in the Temporary Variables section because they do not preserve their values between test runs:

  • Object - The variable can store object references. You cannot specify values of these variables from the editor and their initial values are not set.
  • Table - The variable can store two-dimensional arrays.
  • DB Table - The variable provides access to tabular data from an external storage, such as a database, an Excel or CSV file.
Default Value A project can be shared between several testers working on different workstations (see Using Test Projects in Shared Mode). The variable values are computer-specific. Using the Default Value column, you can specify the value that will be used when the project is opened for the first time on the remote computer. Default Value is stored in the project file and it is common for all computers for all testers that use the project. If you modify a value in this column, the resulting changes will modify the Default Value for all users who share the project with you.

The default value cannot be set or read for Object type variables. The column displays {Object temporary variable [unassigned]} for these variables.

Local Value
This column is available only in the Persistent Variables section.

Specifies the current value of the variable. This value depends on the computer where the project has been opened. That is, the Value column holds the local value of the variable.

The value of the Object type variables can only be set or read during the script execution and cannot be changed from the editor. The Local Value column displays {Object temporary variable [unassigned]} for these variables.

Category The category of the variable. This is a helper value like Description. It serves for more convenient working with variables. For instance, you can sort, filter or group the variables list on the Category column to see only variables of the desired category.
Description Any descriptive text related to the variable.

You can arrange columns in the table using the customization capabilities provided by TestComplete.

To create a project or project suite variable

Right-click within the appropriate section of the Variables page and choose New Item from the context menu.

TestComplete will add a new row to the Variables table. You can then enter desired values into the table fields.

To modify a project or project suite variable

Click the cell you would like to change and edit the cell value using the in-place editor.

To delete a project or project suite variable

Right-click the desired variable in the Variables page and choose Delete from the context menu.

You can also create, modify and delete project and project suite variables from scripts using the Project.Variables and ProjectSuite.Variables objects. For more information, see Working With Project and Project Suite Variables in Scripts.

See Also

Project And Project Suite Variables
Project And Project Suite Variables - Overview
Working With Project and Project Suite Variables in Scripts

Highlight search results