Applies to TestComplete 12.20, last modified on January 17, 2017

The object structure is shown in the Object Browser panel:

The Object Browser Panel
Note: The images in this topic demonstrate the object model of desktop applications. The object model of web and mobile applications is similar.

TestComplete uses a tree-like model for test objects. For desktop and web applications, the root node of the tree is Sys, while for mobile applications, the root node is Mobile.

Processes objects correspond to applications running in the operating system. We use the term process rather than application because it corresponds to the concept of processes in Windows documentation.

A process object’s name includes the name of the process executable and its index (the index is used only if several application instances are running):

Process name

The processes have child objects - windows - that correspond to top-level windows. These objects in their turn have other child window objects that correspond to controls. The window and control names depend on whether or not the test engine has access to internal methods and properties of the application under test. TestComplete works with applications of both types, but names their windows and controls in different ways.

  • Black-box applications

    Applications that do not provide access to their internal methods and properties are called black-box applications. The name of each window of such applications includes the window’s class name, the window’s text or title (caption) and its index. Controls are named in the same manner as windows, because in terms of the operating system, a control is just another type of a window:

    Window name (black-box application)
  • White-Box Applications

    Applications that expose their internal objects, methods and properties to TestComplete are called white-box applications or Open Applications. They are marked with the icon in the Object Browser (see the image below).

    To address windows and controls of Open Applications, TestComplete uses the names that reflect the window or control type and the name defined in the application’s sources. For instance, if you have a form named MainForm in a C# application created with the Microsoft WinForms library, then TestComplete will address this form as WinFormsObject("MainForm"):

    Object name (Open Application)

For detailed information on naming processes, windows and controls, see Naming Objects.

Note: It is recommended that, whenever possible, your tests work with Open Applications rather than black-box applications. This enables the test engine to access the application’s internal methods and properties, allowing you to create more powerful and flexible tests.

Some applications like .NET, WPF, Visual Basic, Java or Web are always “open” to TestComplete. Others may need to be compiled in a special way. For more information on this, see Open Applications.

Prev     Next

See Also

Introducing Automated Testing and TestComplete
Default Naming