Object Identification

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

In automated tests, to simulate user actions on an object in your tested application, you first need to identify the object, that is, to instruct TestComplete on how to locate the object in your tested application. You can identify objects in the following ways:

By Properties

Name Mapping

By default, TestComplete stores all the objects with which your tests interact in the Name Mapping repository. For each object, you can specify properties by which TestComplete will find the object in the application, and a user-friendly name (alias) to address the object from tests.

For Example

Note: Mapped objects are not supported in cross-platform web tests. To learn how to locate objects in such tests, see Addressing Objects in Cross-Platform Web Tests.

Object Browser Naming Notation

All applications, windows, and controls that TestComplete recognizes in your system or on attached mobile devices form a hierarchy. You can view the hierarchy in the Object Browser. Each object in the hierarchy is identified by its type (for example, Process, Window, Browser, Page, WinForms object, XFObject, etc.) and by its properties (for example, ClassName or Caption).

For Example

Using Microsoft Active Accessibility

You can use accessibility information provided by your tested application via the Microsoft Active Accessibility (MSAA) engine to recognize objects in it. Each object will be identified by its accessibility role and properties provided by the engine, for example, Caption.

Using Microsoft UI Automation Technology

You can also use information provided by your tested application via the UI Automation framework to recognize objects in it. In this case, objects will be identified by the properties exposed by UI Automation providers.

By Text Contents

Optical Character Recognition

You can command TestComplete to get and recognize the text of a control on screen and then identify the control or control parts by the text contents.

Using Text Recognition Technology  (For Desktop applications only)

You can identify custom-drawn objects in Windows desktop applications by their text contents.

By Images

Image-Based Testing

If your tested application is a “black-box” application, that it, it provides access neither to its internal properties, nor to its accessibility information and text contents, you can identify individual controls in the application by their images.

Related Topics of Interest

Creating Custom Plugins

You can implement extended support for custom .NET and WPF controls using TestComplete SDK.

Object Mapping

If your custom control’s API is compatible with one of the controls TestComplete supports, you can map your control class to the supported class to command TestComplete to recognize it.

See Also

Testing With TestComplete
Supported Controls

Highlight search results