Working With Custom Child Controls

Applies to TestComplete 15.45, last modified on December 01, 2022

TestComplete has a number of extensions that provide support for a variety of popular third-party controls, such as Java controls, Microsoft .NET controls, Qt controls and others. These extensions are included in the list of installed extensions and add new program objects that allow you to simplify interacting with controls. Normally, a control's program object includes a set of properties and methods typical to onscreen objects, a number of platform-specific properties and methods, and supplementary properties and methods added by TestComplete. For a list of available extensions, see Supported Controls.

TestComplete also makes it possible for you to get access to child elements of supported third-party controls. Each TestComplete project includes special Object Mapping options that hold the list of control types that TestComplete can recognize and work with. Child controls supported by TestComplete are displayed in this list as subnodes of their parent controls. Actually, you can work with a child control the same way you work with its parent. For a list of supported controls, see Object Mapping.

In addition, if your application uses custom child controls inherited from any of the supported classes, you can map them to the appropriate program objects. To specify that TestComplete should treat a custom child control as one of the supported child controls, do the following:

  • Right-click your project in the Project Explorer panel and select Edit | Properties from the context menu. This will open the Project Properties page.
  • Select Object Mapping.
  • In the list of control types, choose the type that corresponds to your custom child control (note that the parent control can contain several child control types).
  • Press Add Class Name and enter the class name of the custom child control that is used in your application.

    Class names are case-insensitive and can contain wildcards (* and ?).

  • Select File | Save from the TestComplete main menu to save an object mapping template for the current project.

Once the child control is mapped, it gets all of the properties, methods and actions specific to the corresponding program object. As for custom child controls that are not inherited from any of the supported classes, TestComplete can interact with them via clicks and keystrokes.

Note that the specified child control must fit the object’s type. Otherwise, it may not properly respond to commands that TestComplete sends, so recording or playing back user actions over the tested control will cause errors.

You can add an object mapping template not only for a custom control in the current project, but also for all new projects created with TestComplete. This is done on the Object Mapping Options page of the Default Project Properties dialog. In this case, all new projects will treat the custom control as a supported one.

See Also

Working With Application Objects and Controls
Object Browser Naming Notation
Interacting With Non-Compatible Application Objects
Installing Extensions

Highlight search results