4 UIA Object Identification
The key Properties defined by UI Automation for the identification of UIA Elements are AutomationId, Name, ControlType and RuntimeId.
In order to enable the most consistent and language-independent identification possible, the IDM object label is therefore assigned as AutomationId for most IDM objects. In case of ambiguities, the IDM-typical indexing :[<No>]
after the label for No >= 2 is used for inherited identifiers. The AutomationId may be overwritten via the .acc_label attribute. In this case, however, the application programmer must ensure uniqueness.
Often the Name Property is also used, which typically represents the visible static text string (not the dynamic content). This may also be overwritten by the application programmer with the .acc_text attribute.
Through these Properties, objects in a UI Automation Element Tree usually are uniquely recognizable.
The RuntimeId is generally based on the Window Handle and may therefore change when attributes are modified. This makes it less suitable for reliable object identification.