Object Tree Models

Applies to TestComplete 15.63, last modified on April 10, 2024

Applications, windows, web pages, and objects that TestComplete recognizes in your system form a hierarchy. Each object has a parent and can have one or several child objects. For example, a window is a child of a process, and window UI elements are children of the window. You can view the hierarchy of processes, windows, and controls in the Object Browser:

Object hiearchy in Object Browser

Click the image to enlarge it.

The top-level objects of the hierarchy:

  • Sys - for Windows desktop and Web applications running on your computer.

  • Mobile - For mobile applications running on devices connected to your computer.

Notes:

  • Each top-level window of a process is always created by that process. A non-top-level window of a process may be created by the same process or by a different process. For instance, the embedded view of a .pdf document within Internet Explorer’s window is actually a non-top-level window created by Adobe Acrobat Reader.

  • Starting from version 4 of TestComplete, the Object Browser does not display message-only windows (in TestComplete 3, the Object Browser used to show those windows). Those windows are used to send and receive messages. They just dispatch messages; they are not visible, have no Z-order, cannot be enumerated, and do not receive broadcast messages. Thus, these windows are useless in TestComplete tests and are not visible in either tree model.

You can use one of the following models to represent the parent-child relationship between objects:

  • Tree (default) - Uses the actual parent-child relationship.

  • Flat - All child objects of a process are top-level windows. All other windows are child objects of the top-level windows regardless of their actual parent-child relationship. That is, all child windows are at the same level of the object hierarchy (the only exception is MDI windows, for which TestComplete always traces parent-child relationship).

    This model makes the object full name shorter.

    Note: This model is used in TestComplete version 3 and earlier. For your legacy script tests to work in the current version of TestComplete, set the Object tree model of your projects to Flat. We do not recommend that you use this model for creating new tests.

The selected model affects not only the way objects are displayed in the Object Browser, but also the way they are accessed from tests. For instance, tests created for the Tree model will not work properly if you change the object tree model to Flat and vice versa.

To trace parent-child relationships from tests, you can use the following methods:

See Also

About Object Browser Naming Notation
Naming Web Objects
Exploring Applications
Project Properties - General Options
Object Browser Options Dialog

Highlight search results