Keyword Test Editor - Variables Page

Applies to TestComplete 15.69, last modified on November 13, 2024

On the Variables page of the Keyword Test editor, you can create, modify, and delete keyword test variables. You can use these variables to parameterize operations and pass data from one operation to another during the test run.

The following image demonstrates the overall view of the Variables page:

Variables page of the Keyword Test editor

Click the image to enlarge it.

Information on the panel

The page is a table that provides information about the variables. Each row in this table corresponds to a single variable. Table columns show properties of this variable:

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 used in your project. The easiest way to follow this rule is to enter a name that consists of only alphanumeric or underscore characters and starts with a letter.
Type Specifies 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. You cannot specify values of these variables from the editor.

  • Password - The variable stores encrypted strings.

  • Table - The variable stores a two-dimensional array of values.

    The Keyword Test editor also displays table variables on the editor’s Test Steps page under the operations tree.

  • DB Table - The variable stores tabular data from an external storage (a file or a database).

Default Value Specifies the value that will be assigned to the variable when the keyword test starts.
Note: Object variables cannot have default values; they can only be initialized in tests.
Category The category of the variable. This is a helper value like Description. It allows you to sort, filter or group the variables list on the Category column to see the variables of a desired category.
Description Any descriptive text related to the variable.

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

Variables page toolbar

The Variables page toolbar contains the following commands:

Add Variable - Adds a new variable to the current keyword test.

Delete - Removes the selected variable from the current keyword test.

Working with variables

Creating new variables
  • Click Add Variable on the page toolbar.

– or –

  • Right-click within the Variables page and then click New Item.

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

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

Deleting variables
  • Select the variable you want to delete, and then click Delete on the page toolbar.

– or –

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

Note that you can also create, modify and delete variables directly from your tests using the KeywordTests.TestName.Variables object.

See Also

Keyword Tests
About Keyword Test Editor
Keyword Test Variables

Highlight search results