Search Control command enables MSAA support
Learn how to use the Search Control command to search for controls in Windows™ application according to controls selectors like Id
, Name
,
Text
, Element Value
, Class
, Type
, Index
, Control Width
, and Control Height
. You can also use it to reference control's trees generated by Microsoft Active
Accessibility (MSAA).
In the following example, the Search Control searches for an instance of a control by using its Name
attribute as a reference in the Notepad application.
Index Path
Use the Index Path parameter to reference MSAA-generated control trees. The following example uses the Inspect.exe 🡥 tool, which is a tool that is provided by Windows™ SDK that you can use to find UI elements and display the element's accessibility data. Select the "Save" element in notepad to visualize the index corresponding to the position of the element in the control tree that is built by MSAA and displayed by the ChildId property.
The index path is separated by a comma, and each index corresponds to the element's position in the control tree built by MSAA.
The Search Control command only employs MSAA indexed path search when Index Path is set. Otherwise, this command uses UIAutomation API search.