If Object Operation

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

Description

The If Object operation checks the state of an object and then executes the child operations if the object is in the specified state.

When you add the operation to a keyword test, TestComplete displays the Operation Parameters wizard where you can specify the desired object and the state to be checked.

Operation Result

The operation does not return any value.

Scripting Analogue

The operation is a keyword test analogue to checking the object properties in script with the if... then statement.

Child Operations

The operation can have any other operation (or operations) as a child.

For information on how to make an operation a child of another operation, see the description of the Keyword Test editor’s Test Steps page.

Operation Parameters

The operation uses the following parameters:

  • The object, whose state to be checked.
  • The name of the state to be checked.

When you add the operation to your keyword test, TestComplete displays a wizard that lets you specify these parameters. To modify parameters of an operation that is already added to the test, you can use special dialogs and in-place editors provided by the Keyword Test editor. These dialogs and in-place editors are analogues to the wizard’s pages.

Specifying Parameters When Adding the Operation

The Operation Parameters wizard contains the following pages:

Select Object

On this page you specify the object whose state will be checked. To specify the object, you can select it on screen, or, if the object is mapped, choose the object’s mapped name or alias. For detailed information, see Selecting Objects for Keyword Test Operations.

Select Condition

On this page you can specify the object state to be checked. The page lists the following states:

  • Exists
  • Does not exist
  • Enabled
  • Disabled
  • Visible
  • Invisible

Modifying Parameters

After adding the operation to the test, you can modify the operation parameters with the same wizard that you used to add the operation. To invoke the wizard, simply double-click the operation’s row in the Keyword Test editor.

To modify parameters of the operation, you can also use the in-place editors and dialogs provided by the Keyword Test editor.

To change the object:

  • Select the operation in the test.

  • Click within the Operation cell twice (not a double-click), or select the cell and press F2. This will activate the in-place editor.

  • Click the ellipsis of the in-place editor. This will invoke the Select Object dialog, in which you can choose the desired object.

  • Select the object and close the dialog by clicking OK.

  • Press Enter to apply the changes and close the in-place editor. Press Esc to discard the changes.

To select another state to be checked:

  • Select the operation in the test.

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

  • Choose the desired state from the drop-down list of the in-place editor.

  • Press Enter to apply the changes and close the in-place editor. Press Esc to discard the changes.

See Also

Test Actions Category
Specifying Operation Parameters
Selecting Objects for Keyword Test Operations
Checking Operation Result
If... Then Operation

Highlight search results