Set Variable Value Operation

Applies to TestComplete 15.45, last modified on December 01, 2022

Description

Use the Set Variable Value operation to assign values to a keyword test variable or to project, project suite, or network suite variables in keyword tests:

Set Variable Value operation in a keyword test in TestComplete

Click the image to enlarge it.

Operation Result

The operation does not return any value.

Scripting Analogue

The operation is a keyword test analogue to setting the variable values from a script.

Child Operations

The operation cannot have child operations.

Operation Parameters

When you add the operation to your keyword test, TestComplete displays the wizard that contains the following pages:

Select Variable

On this page, you select the variable whose value you want to set.

To create a new variable, click Add Variable and enter the variable name, select its type and value.

Table Indexes

The wizard shows this page if the selected variable is a table variable.

On this page, specify the column and row index of the table cell the value of which you want to set. Both column and row indexes are zero-based. You can either type the desired index or click the ellipsis button and specify it in the ensuing Edit Parameter dialog.

Set New Value

On this page, you specify the value you want to set to a variable:

NewValue

Variant. Specifies the value to be assigned to the variable.

You can type the value, or you can select an existing parameter or variable the value of which you want to set to the variable, or you can specify a code expression the result of which you want to set to a variable, and so on. To learn more, see Specifying Operation Parameters.

Modifying Parameters

After the operation was added to the test, you can change the operation parameters.

To specify another variable:

  1. Select the Set Variable Value operation in the Keyword Test editor.

  2. Click within the Operation cell and choose the desired variable from the drop-down list.

  3. Press Enter to confirm the changes and to close the in-place editor. Press Esc to close the editor discarding any changes.

To change the value to be assigned:

  1. Select the Set Variable Value operation in the Keyword Test editor.

  2. Click the Value cell twice (not a double-click) or select the Value cell and press F2. This will activate the cell’s in-place editor.

  3. Click the ellipsis button of the in-place editor. This will invoke the Edit Value dialog, in which you can specify the needed value. For information on settings values in this dialog, see Specifying Operation Parameters.

  4. Press OK in the dialog to apply the changes and to close the dialog.

  5. Press Enter to confirm the changes and to close the in-place editor. Press Esc to close the editor discarding any changes.

See Also

Statements Category
Specifying Operation Parameters
Checking Operation Result
Keyword Test Variables
Project And Project Suite Variables
Variables Object

Highlight search results