Compartir a través de


UI Automation Overview

Actualización: noviembre 2007

Automatización de la interfaz de usuario de Microsoft is the new accessibility framework for Microsoft Windows, available on all operating systems that support Windows Presentation Foundation (WPF).

Automatización de la interfaz de usuario provides programmatic access to most interfaz de usuario (UI) elements on the desktop, enabling assistive technology products such as screen readers to provide information about the interfaz de usuario to end users and to manipulate the interfaz de usuario by means other than standard input. Automatización de la interfaz de usuario also allows automated test scripts to interact with the interfaz de usuario.

Nota:

Automatización de la interfaz de usuario does not enable communication between processes started by different users through the Run as command.

UI Automation client applications can be written with the assurance that they will work on multiple frameworks. The Automatización de la interfaz de usuario core masks any differences in the frameworks that underlie various pieces of interfaz de usuario. For example, the Content property of a WPF button, the Caption property of a Win32 button, and the ALT property of an HTML image are all mapped to a single property, Name, in the Automatización de la interfaz de usuario view.

Automatización de la interfaz de usuario provides full functionality in Windows Vista, Microsoft Windows XP, and Windows Server 2003.

UI Automation providers offer some support for Microsoft Active Accessibility client applications, through a built-in bridging service.

Este tema contiene las secciones siguientes.

  • Providers and Clients
  • UI Automation Model
  • Temas relacionados

Providers and Clients

Automatización de la interfaz de usuario has four main components, as shown in the following table.

Component

Description

Provider API (UIAutomationProvider.dll and UIAutomationTypes.dll)

A set of interface definitions that are implemented by UI Automation providers, objects that provide information about interfaz de usuario elements and respond to programmatic input.

Client API (UIAutomationClient.dll and UIAutomationTypes.dll)

A set of types for managed code that enables UI Automation client applications to obtain information about the interfaz de usuario and to send input to controls.

UiAutomationCore.dll

The underlying code (sometimes called the Automatización de la interfaz de usuario core) that handles communication between providers and clients.

UIAutomationClientsideProviders.dll

A set of UI Automation providers for standard legacy controls. (WPF controls have native support for Automatización de la interfaz de usuario.) This support is automatically available to client applications.

From the software developer's perspective, there are two ways of using Automatización de la interfaz de usuario: to create support for custom controls (using the provider API), and creating applications that use the Automatización de la interfaz de usuario core to communicate with interfaz de usuario elements (using the client API). Depending on your focus, you should refer to different parts of the documentation. You can learn more about the concepts and gain practical how-to knowledge in the following sections.

Section

Subject matter

Audience

UI Automation Fundamentals (this section)

Broad overviews of the concepts.

All.

UI Automation Providers for Managed Code

Overviews and how-to topics to help you use the provider API.

Control developers.

UI Automation Clients for Managed Code

Overviews and how-to topics to help you use the client API.

Client application developers.

UI Automation Control Patterns

Information about how control patterns should be implemented by providers, and what functionality is available to clients.

All.

UI Automation Text Pattern

Information about how the Text control pattern should be implemented by providers, and what functionality is available to clients.

All.

UI Automation Control Types

Information about the properties and control patterns supported by different control types.

All.

The following table lists Automatización de la interfaz de usuario namespaces, the DLLs that contain them, and the audience that uses them.

Namespace

Referenced DLLs

Audience

System.Windows.Automation

UIAutomationClientUIAutomationTypes

UI Automation client developers; used to find AutomationElement objects, register for Automatización de la interfaz de usuario events, and work with Automatización de la interfaz de usuario control patterns.

System.Windows.Automation.Provider

UIAutomationProviderUIAutomationTypes

Developers of UI Automation providers for frameworks other than WPF.

System.Windows.Automation.Text

UIAutomationClientUIAutomationTypes

Developers of UI Automation providers for frameworks other than WPF; used to implement the TextPattern control pattern.

System.Windows.Automation.Peers

PresentationFramework

Developers of UI Automation providers for WPF.

UI Automation Model

Automatización de la interfaz de usuario exposes every piece of the interfaz de usuario to client applications as an AutomationElement. Elements are contained in a tree structure, with the desktop as the root element. Clients can filter the raw view of the tree as a control view or a content view. (These standard views of the structure can easily be seen by using the UI Spy application included with this kit de desarrollo de software (SDK)). Applications can also create custom views.

AutomationElement objects expose common properties of the interfaz de usuario elements they represent. One of these properties is the control type, which defines its basic appearance and functionality as a single recognizable entity: for example, a button or check box.

In addition, elements expose control patterns that provide properties specific to their control types. Control patterns also expose methods that enable clients to get further information about the element and to provide input.

Nota:

There is not a one-to-one correspondence between control types and control patterns. A control pattern may be supported by multiple control types, and a control may support multiple control patterns, each of which exposes different aspects of its behavior. For example, a combo box has at least two control patterns: one that represents its ability to expand and collapse, and another that represents the selection mechanism. For specifics, see UI Automation Control Types.

Automatización de la interfaz de usuario also provides information to client applications through events. Unlike WinEvents, Automatización de la interfaz de usuario events are not based on a broadcast mechanism. Automatización de la interfaz de usuario clients register for specific event notifications and can request that specific Automatización de la interfaz de usuario properties and control pattern information be passed into their event handlers. In addition, a Automatización de la interfaz de usuario event contains a reference to the element that raised it. Providers can improve performance by raising events selectively, depending on whether any clients are listening.

Vea también

Conceptos

UI Automation Tree Overview

Información general acerca de los patrones de control de automatización de la interfaz de usuario

UI Automation Properties Overview

UI Automation Events Overview

UI Automation Security Overview