HasFocus
bool HasFocus(string control)Description
Checks whether the UI control currently has keyboard focus.
This corresponds to the HasKeyboardFocusProperty in UIAutomation.
Typical use cases
- Active input field
- Focused button
Parameters
- control - Identifier of the UI control.
Returns
- bool - True if focused, false otherwise.
Example
void main()
{
VerifyEqual(HasFocus("TXT_USERNAME"), true);
}