UI Spy Tasks
This section explains how to perform common UI Spy tasks.
This topic contains the following sections.
When you start UI Spy, the Control View of the UI Automation tree is displayed. You can access other views (Content or Raw) of the UI Automation tree from the View menu. For more information about views of the UI Automation tree, see UI Automation Tree Overview.
To view a specific UI item and its descendants in the UI Automation tree, select the UI item in the appropriate View pane and click CTRL + >, or right-click and select Scope To Element. The UI item and its descendants appear in the View pane, and the highlighted item's properties appear in the Properties pane. To refresh the full UI Automation tree, deselect Scope to Element. To refresh the entire tree, press F5.
If you have implemented a UI Automation provider for a UI item and you have properly implemented navigation, or if you are using a control with support for UI Automation such as comctl32, the UI item is displayed at the correct level within the UI Automation tree. For example, the navigation for a dialog box that includes an edit control has been properly implemented if the UI Automation tree for the control shows the edit control as a child node below the dialog box.
When you start UI Spy, the Properties pane is displayed in the right-hand side of the main window. To configure which UI Automation properties are displayed, open the View menu and select Configure Properties. The Properties Selection window opens and enables you to configure the list of properties that appear in the Properties pane. If you have implemented a UI Automation provider, or if you are using a control with support for UI Automation such as comctl32, UI Spy displays the UI Automation properties.
UI Automation control patterns provide a way to categorize and expose a control's functionality independent of the control type or the appearance of the control. For example, you use the Invoke control pattern for controls that can be invoked (such as buttons), and the Scroll control pattern for controls that have scroll bars (such as list boxes, list views, or combo boxes). When a UI Automation provider implements one of these control pattern interfaces, UI Automation clients can use corresponding classes to programmatically manipulate the UI item. For more information on control patterns, see UI Automation Control Patterns Overview.
UI Spy enables you to use control pattern classes to manipulate UI items. You can choose from a list of implemented control patterns, choose a method from a control pattern class and specify parameters for the method. UI Spy calls the method and displays any output in the Output window.
UI Spy enables you to define a snapshot of the UI and save UI Automation information for that snapshot to an XML file. You can save the information from a specified point or from the root directory.
Saving all of the information from the UI Automation tree from the root can be time-consuming.
If you have previously saved a snapshot, you can load that snapshot and UI Spy displays a bitmap version of the UI Automation tree. Property values are displayed in the Properties window.