Access Objects by Aliases

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

In addition to recording tests, you can create and edit tests manually. When you add a new test command, you specify the alias of the object the command will use. An alias is an object name in the Name Mapping repository. You can specify the needed alias in the following ways:

  • In keyword tests

    • When you add or edit an operation that calls methods or properties, or simulates user actions on windows, controls and other objects, you specify the object with which the operation will work. In the Select Object dialog, enter the needed alias manually or select if from the Aliases tree:

      Selecting the target object for a keyword test operation

      Click the image to enlarge it.

      Note: If the needed object is not mapped yet, click Map New Object to map the object manually.
      If TestComplete is configured to map objects automatically, you can also select the object from screen. TestComplete will add it to the Aliases tree and select it automatically.

  • In scripts

  • Using copy and paste (both in keyword tests and in scripts):

    • Copy object aliases from the Name Mapping editor and paste them into your test:

      Copying an alias from the Name Mapping editor
    • Select an object on the screen using the Object Spy, copy the object’s name and paste it into your test:

      Copying an alias from the Object Spy

See Also

How To
Name Mapping
About Script Tests
Keyword Tests
Creating Tests

Highlight search results