Skip to content
Descolada edited this page Jan 16, 2023 · 2 revisions

Welcome to the UIAutomation wiki!

Short intro for UIAutomation

UIAutomation is a Microsoft accessibility framework that allows interacting with user-accessible elements (clicking buttons, sending text etc) in a programmatic way. It is the successor to the Acc/MSAA framework. For more detailed information, check out Microsofts documentation for UIA.

How it works

  1. Using an inspect tool (Accessibility Insights, UIAViewer (run UIA.ahk alone), inspect.exe, or AHK v1 UIA tools UIAViewer, UIATreeInspector), inspect your element of interest: a button you want to click, checkbox you want to check etc
  2. In the inspect tool find a characteristic of the element that you can use to identify it from other elements: this might be a Name, AutomationId, or something else
  3. Get a starting point element: usually the window element with UIA.ElementFromHandle, root element (desktop) with UIA.GetRootElement, etc
  4. Use one of the Find methods in combination with the unique characteristic(s) to get your element of interest from the starting point element
  5. Now you can get information about the element or interact with it

Continue on in this Wiki to find more about UIAutomation tree, elements, patterns, and more.