Occasional Contributor
Posts: 7
Registered: ‎05-12-2010

Flex: how to check if the control has focus?


I'm testing a Flex application and I need to check if some specific control (textbox, button) is focused after performing some actions. But I can't find any property that would let me know if the control has a focus.

Does anybody know a way how to do that?

Posts: 415
Registered: ‎12-14-2010

RE: Flex: how to check if the control has focus?


TestComplete adds a special property named FlexObject to each object of the Flex Open Application. This property provides a scripting interface to the underlying Flex object and lists all of the public methods and properties of this object. Using the FlexObject property, you can get and set native Flex property values and call native Flex methods from your tests.

For example, you can use the native focusManager property to get access to the Flex FocusManager class that manages the focus on components in response to the mouse or keyboard activity. Particularly, the FocusManager's getFocus property gets the component that currently has the focus.

I’m not a member of the SmartBear Support Team, I’m just helping users in this community. Any views or opinions expressed do not necessarily represent those of SmartBear Software.
Try QAComplete Now