Editing the UI Automation Selector Syntax
To uniquely identify a control in a program (ui)
The query must always start with [ui.]
Syntax |
Purpose |
Example |
Behavior and Logic |
---|---|---|---|
|
Identifies control by index in parent |
|
Selects window (ui.) > forth child (c[3]), sixth child (c[5]), and first child (c[0]) |
|
Identifies control by name |
|
Selects window (ui.) > element with name “Delete” > element's sixth child |
|
Identifies control by type |
|
Selects window (ui.) > element with type “Pane” > control with name “BuyMe” |
|
Identifies control by className |
|
Selects window (ui.) > element with className “TDBPane” Different platforms have different ClassName. For example, in delphi button it is called TButton, while in QT it’s called QTButton. |
The selection performs a full tree search and it also knows how to go back in a middle of a query and select another path to traverse. For example, a tree might have these elements:
-
Window
-
Checkbox
-
Pane
-
Button
The query .ui.t(Pane).t(Button)
works. The internal control finder returns back to search another 'Pane' once it sees the “Checkbox”.