|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.
|Using the Microsoft UI Automation technology on Windows XP, Windows Vista, Windows Server 2003 or Windows Server 2008 requires that Windows Automation API 3.0 be installed. It can be installed from Windows Update or downloaded from Microsoft’s web site:
Windows Automation API 3.0 is included in Windows 7, Windows 8, Windows 10, Windows Server 2008 R2 and Windows Server 2012 by default, so, you do not need to install it manually in these operating systems.
Support for Windows XP, Vista and Windows Server 2003 and 2008 has been discontinued. Though TestComplete can run on these operating systems, we do not recommend creating tests on them.
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:
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
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.