This property is not supported in web tests (including cross-platform web tests) that use XPath expressions and CSS selectors to locate web elements. This property can be only used in tests that locate web objects by using internal identification properties provided by TestComplete. |
Description
The Focused
property specifies whether the given object has the input focus. To move the focus to an object, use the SetFocus method.
Declaration
TestObj.Focused
Read-Only Property | Boolean |
TestObj | A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section |
Applies To
The property is applied to the following objects:
Flex Button, Flex CheckBox, Flex ComboBox and 2 more objects, Flex List, Flex RadioButton « Collapse the list
View Mode
To view this property in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.
Property Value
True if the object has the focus; otherwise, False.
Remarks
The Focused
property may be absent in some objects listed in the Applies To section and may be present in other objects. This depends on the implementation of the IAccessible.State
property on a particular object.
Do not confuse the focused and selected states:
-
The focused object is the currently active object, which has the input focus.
-
A selected object is the one that is simply marked (for example, one of items selected in a list box). At that, a selected object may or may not be focused. To check if the object is selected, use the
Checked
property.
See Also
SetFocus Method (Flex Objects)
Checked Property (Specific to CheckBox and RadioButton Flex Objects)