Add Variable to Keyword Test Wizard

Applies to TestComplete 15.40, last modified on July 05, 2022

The Add Variable to Keyword Test wizard creates keyword test variables and adds them to the current keyword test. Use this wizard to specify the variable name, type, description and value.

The wizard is called when you click the Add Variable button in some wizards and dialogs that appear when adding operations to your keyword test or specifying operation parameters.

The wizard includes two pages:

Variable Name and Type

On the first 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 this 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

After specifying the new variable’s name, type and default value (optional), click Finish. This will close the wizard and add the new variable to the keyword test. Cancel will close the wizard without performing any actions.

The created variable will appear on the Variables page of the Keyword Test editor. On this page, you can delete or modify the variable.

See Also

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

Highlight search results