Use this method to obtain a scripting interface to a child object of the WindowObj window or control. This child object is identified by its text and is exposed by the Text Recognition plugin.
|TestObj||A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section|
|Index||[in]||Optional||Integer||Default value: 1|
The method is applied to the following object:
To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.
The method has the following parameters:
The object’s text that is recognized by the Text Recognition subsystem and used to identify the object. Wildcards (* and ?) can be used in this parameter.
Index of the object relative to other objects that have the same text. TestComplete generates indexes for objects corresponding to window elements that contain the same text. The leftmost element has an index of 1. The elements that have the same horizontal position are indexed from top to bottom.
To determine the index of the desired window element, explore the application windows and controls in the TestComplete Object Browser.
TextObject method returns the
TextObject object that provides a scripting interface to a window or control element recognized by its text.
To determine whether the method returns a valid object, use the
Exists property of the resultant object. If this property returns False, then the returned object is a stub object and the call to
TextObject was not successful.
When calling this method in TestComplete scripts you can skip the method name (
TextObject) and only specify the text displayed on the desired element of the window.
However, it can be useful if there are no elements of the window with the same text displayed on them and you do not need to specify the index of the object to get access the desired element (otherwise, the object with index 1 will be returned).
To view an example that demonstrates how to use the
TextObject method, see Using Text Recognition Technology - Overview.
Object Browser Naming Notation
About Open Applications
Using Microsoft UI Automation Technology - Overview