Using Microsoft UI Automation Technology - Overview

Applies to TestComplete 14.92, last modified on September 16, 2021
Information in this topic applies to desktop and web applications.

Microsoft .NET Framework v.3.0 and later includes a special UI Automation Framework. One of its purposes is to assist in application testing by providing program access to user interface elements. TestComplete includes a special plugin, UI Automation Support, that provides support for the UI Automation technology. For more information on the plugin, see Requirements.

If the plugin is installed, TestComplete uses the UI Automation providers to obtain information on UI elements of the application under test. UI Automation Framework includes special providers that expose properties of buttons, check boxes, menus and menu items, data grids, list boxes and other controls. For more information, please see Windows SDK documentation.

Currently, the plugin only supports properties exposed by standard providers. That is, if your application implements a custom provider exposing specific properties, they will not be available to TestComplete.

Note: The UI Automation Support plugin only exposes properties of those windows whose class names are specified by the UI Automation project properties. So, in order to work with windows via UI Automation, you may need to use these properties to select the desired window classes.

Which properties are retrieved by TestComplete depends on the control type. All retrieved properties are displayed in the Object Browser’s Properties page:

Object Browser displays properties exposed by the UI Automation providers

You can then use these properties for testing.

If a property name coincides with the name of a property, method or action that is provided by TestComplete, this automation’s property is moved to the NativeUIAObject namespace.

If TestComplete retrieves the Name property, then it uses the UIAObject method to address the object (this method is added by the UI Automation Support plugin for the TestComplete process and window objects).

Note that the name must be a valid identifier, that is, it must start with a letter and contain no spaces or other disallowed characters. If the name contains these type of characters, TestComplete replaces them with underscores. However, in some cases even replacements cannot make the name a valid script identifier.

So, if TestComplete is unable to retrieve the Name property or if it cannot make the name a valid identifier, TestComplete addresses the object in the usual way, that is, by class name, caption and index (that is, Window("WndClassName", "WndCaption", WndIndex)). Other properties that were exposed by UI Automation providers are still displayed in the Object Browser.

See Also

Using Microsoft UI Automation Technology
Requirements
UIAObject Method

Highlight search results