GetName
void GetName(string control)Description
Retrieves the accessible name of a UI control.
This corresponds to the NameProperty in UIAutomation.
It is usually the label or caption assigned to the control by the developer.
Typical use cases
- Buttons (e.g. a button labeled "OK" → Name = "OK")
- Labels and static texts
- Window captions
Parameters
- control - Identifier of the UI control.
Returns
- string - The accessible name of the control.
Example
void main()
{
string btnName = GetName("BTN_OK");
VerifyEqual(btnName, "OK");
}