WPF User Interface Automation

UI Automation provides a single, consistent, reference object for UI elements in multiple frameworks (For example, Win32, WPF, and Trident). With UI Automation, the functionality of objects in the UI is defined by a set of standard control patterns and properties that are common to all objects of that type.

WPF uses UI (User Interface) Automation to define UI objects. UI Automation provides standardization of controls and properties for the functionality of objects. The .NET Add-in supports UI Automation through the AutomationElement and AutomationPattern properties.

To learn more about UI Automation, see MSDN UI Automation Fundamentals.

The UI Automation elements include:

Automation Elements

UI Automation exposes every element in the UI as an Automation Element. Automation Elements expose common properties of the UI elements they represent.

For example, a button control has the Automation Element property NameProperty, which references the name or text associated with a button control. That same property is called caption or alt in Win32 and HTML, respectively. With UI Automation, all button controls have a NameProperty, which is mapped to the corresponding property in each framework.

The Automation Element also exposes control patterns that provide properties and expose methods specific to their control types.

Control patterns

Control patterns represent discrete pieces of functionality that a control in the UI can perform. The total set of control patterns for a control type define the functionality of that control type.

Control patterns expose methods that provide the ability to programmatically manipulate the control. Control patterns also expose properties that provide information on the control's functionality and current state.

The set of supported control patterns for a particular control can be dynamically defined. Therefore, a particular control type may not always support the same set of control patterns. For example, a multiline edit box supports scrolling (scrollpattern pattern) only if its text exceeds the viewable area.

Some controls types, such as Image controls do not support any control patterns.

UFT enables you to access the methods and properties of automation elements and control patterns using special properties in the UFT object model for WPF.