Forum Discussion

igork's avatar
igork
Occasional Contributor
13 years ago

Flex: how to check if the control has focus?

Hello,



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?



Thanks!

1 Reply

  • Hi,


    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.