Add Variable Wizard

Applies to TestComplete 14.70, last modified on April 22, 2021

The Add Variable wizard creates new variables for keyword tests, projects, project suites or network suites. By using this wizard you can specify a variable’s name, type, description and value. You invoke the wizard from the Operation Parameters dialog that is used to specify parameters of keyword test operations.

The wizard includes several pages.

Variable Location Page

The first page of the wizard allows you to specify where the variable will be added. It may be the current keyword test, project, project suite or network suite.

To switch to the next page of the wizard, click Next.

Variable Name and Type Page

On this page, you can specify variable properties that are needed for variable creation:

  • Specify the variable name in the Name edit box.

    Note: The variable name is used to address the variable in scripts, so it must match the naming rules of the scripting language used in your project. The easiest way to follow this rule is to enter a name that only consists of alphanumeric or underscore characters and starts with a letter.
  • In the Type box, specify the variable’s type. The following types are possible:
    • 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.
    • Object - The variable can store object references.
    • Password - The variable can store encrypted string values.
    • Table - The variable stores a two-dimensional array or values.
    • DB Table - The variable stores tabular data from an external storage (a file or a database).
  • In the Description edit box, specify any descriptive text related to the variable.

To switch to the next page of the wizard, click Next. Finish will generate the variable that has the following default value:

  • Boolean: false.
  • Double: 0.
  • Integer: 0.
  • String: empty string.
  • Object: unassigned (no reference).
  • Password: empty string.
  • Table: empty table (no rows and columns).
  • DB Table: empty string.

Variable’s Default Value

On the last page, specify the value which the variable will have by default.

The page’s content depends on the variable type specified on the previous page. For example, if you specify the Table type, using the Variable’s default value page you can change the dimension of the array that will be stored in the variable and specify values of the array’s elements. For more information about this, see Working With Table Variable Editor. If you are creating the Object variable, this page is not available at all.

If you are creating a DB table variable, select the DB table value in the Type drop-down list and specify the variable in the ensuing Add DB Variable to Keyword Test wizard.

Working with the Wizard

To close the wizard and add a new variable to a keyword test, project or project suite, click Finish. Cancel will close the wizard without performing any actions.

After creating a variable, it will appear on the Variables page of the Project, Project Suite or Keyword Test editor. Using this page, you can delete or modify the variable.

See Also

Using Variables
Keyword Test Variables
About Keyword Test Editor
Keyword Test Editor - Variables Page

Highlight search results