InsightObject Object
Description
An object identified using image-based recognition.
IMPORTANT
Insight test objects are always created as children of the test object that contains them. You can then move the InsightObject under a different parent object in the Object Repository. For example, you may want the parent object to be another Insight object instead of a Standard Windows object.
OpenText Functional Testing searches for the Insight object in the application within the parent object defined in the Object Repository.
Operations
The sections below list the built-in methods and properties that you can use as operations for the InsightObject object.
Note: You can also view a list and descriptions of the InsightObject description properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.
Methods
![]() | Saves a screen capture of the object as a .png or .bmp image, depending on the specified file extension. |
![]() | Checks whether the specified object property achieves the specified value within the specified timeout. |
![]() | Clicks the object. |
![]() | Clicks the object, without first bringing its parent into focus. |
![]() | Double-clicks the object. |
![]() | Performs the 'drag' part of a drag and drop operation. |
![]() | Performs the 'drop' part of a drag and drop operation. |
![]() | Returns the collection of properties and current values from the object in the application. |
![]() | Returns the current value of the specified description property from the object in the application. |
![]() | Returns the collection of properties and values used to identify the object. |
![]() | Returns the value of the specified description property from the test object description. |
![]() | Highlights the object in the application. |
![]() | Returns the text from the specified area. |
![]() | Places the pointer on the object. |
![]() | Presses and holds the left mouse button for a specific number of seconds. |
![]() | Retrieves the current value of an item and stores it in a specified location. |
![]() | Instructs OpenText Functional Testing to re-identify the object in the application the next time a step refers to this object. |
![]() | Sets the value of the specified description property in the test object description. |
![]() | Returns a string that represents the current test object. |
![]() | Types the specified string in the object. |
![]() | Types the encrypted value in the object. |
![]() | Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step. |
Properties
![]() | Checks whether the object currently exists in the open application. |
Click Method
Description
Clicks the object.
Syntax
object.Click [x], [y], [Button]
Arguments
Parameter | Description |
---|---|
x |
Optional. An integer value. The x-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object. Default value = -9999 |
y |
Optional. An integer value. The y-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object.
Default value = -9999 |
Button |
Optional. A predefined constant or number. The mouse button used to click the object. Default value = micLeftBtn |
Return Type
None
IMPORTANT
If the coordinates are not provided, the method is performed at the object's ClickPoint. You can view and modify a test object's ClickPoint in the Object Repository, using the Change Test Object Image dialog box. For details, see the OpenText Functional Testing User Guide.
This method brings the Insight object’s parent test object into focus before performing the click. If this hides your Insight object in the application, making it impossible for OpenText Functional Testing to find and click it, you can use the InsightObject.ClickSpecial method, which does not bring the parent test object into focus before clicking. (Note: The parent test object that is brought into focus is the lowest-level parent that supports the MakeVisible method.)
Example
ClickSpecial Method
Description
Clicks the object, without first bringing its parent into focus.
Syntax
object.ClickSpecial [x], [y], [Button]
Arguments
Parameter | Description |
---|---|
x |
Optional. An integer value. The x-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object. Default value = -9999 |
y |
Optional. An integer value. The y-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object.
Default value = -9999 |
Button |
Optional. A predefined constant or number. The mouse button used to click the object. Default value = micLeftBtn |
Return Type
None
IMPORTANT
Use this method instead of the regular InsightObject.Click method, if bringing the Insight object’s parent test object into focus before performing the click hides your Insight object in the application.
Example
DblClick Method
Description
Double-clicks the object.
Syntax
object.DblClick [x], [y], [Button]
Arguments
Parameter | Description |
---|---|
x |
Optional. An integer value. The x-coordinate of the double-click. Note that the specified coordinates are relative to the upper left corner of the object. Default value = -9999 |
y |
Optional. An integer value. The y-coordinate of the double-click. Note that the specified coordinates are relative to the upper left corner of the object. Default value = -9999 |
Button |
Optional. A predefined constant or number. See the Constants table, below. The mouse button used to double-click the object. Default value = micLeftBtn |
Return Type
None
IMPORTANT
If the coordinates are not provided, the method is performed at the object's ClickPoint. You can view and modify a test object's ClickPoint in the Object Repository, using the Change Test Object Image dialog box. For details, see the OpenText Functional Testing User Guide.
Example
Drag Method
Description
Performs the 'drag' part of a drag and drop operation.
Syntax
object.Drag [x], [y], [Button]
Arguments
Parameter | Description |
---|---|
x |
Optional. An integer value. The x-coordinate within the window from which the object is dragged. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object. Default value = -9999 |
y |
Optional. An integer value. The y-coordinate within the window from which the object is dragged. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object. Default value = -9999 |
Button |
Optional. A predefined constant or number. See the Constants table, below. The mouse button used to drag the object. Default value = micLeftBtn |
Return Type
None
IMPORTANT
If the coordinates are not provided, the method is performed at the object's ClickPoint. You can view and modify a test object's ClickPoint in the Object Repository, using the Change Test Object Image dialog box. For details, see the OpenText Functional Testing User Guide.
Example
Drop Method
Description
Performs the 'drop' part of a drag and drop operation.
Syntax
object.Drop [x], [y]
Arguments
Parameter | Description |
---|---|
x |
Optional. An integer value. The x-coordinate of the object onto which the object is dropped. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object. Default value = -9999 |
y |
Optional. An integer value. The y-coordinate of the object onto which the object is dropped. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object. Default value = -9999 |
Return Type
None
IMPORTANT
If the coordinates are not provided, the method is performed at the object's ClickPoint. You can view and modify a test object's ClickPoint in the Object Repository, using the Change Test Object Image dialog box. For details, see the OpenText Functional Testing Help Center.
Example
GetVisibleText Method
Description
Returns the text from the specified area.
Syntax
object.GetVisibleText ([left], [top], [right], [bottom], [Language])
Arguments
Parameter | Description |
---|---|
left |
Optional. An integer value. The left coordinate of the search area, relative to the top-left corner of the test object image. Default: 0 (the left edge of the object) |
top |
Optional. An integer value. The top coordinate of the search area, relative to the top-left corner of the test object image. Default: 0 (the top edge of the object) |
right |
Optional. An integer value. The right coordinate of the search area.
|
bottom |
Optional. An integer value. The bottom coordinate of the search area
|
Language |
Optional. A String value. The language dictionary that the OCR mechanism should use to identify the text. |
Return Type
A String value.
IMPORTANT
- OpenText Functional Testing captures the text using an OCR (optical character recognition) mechanism.
- The text to capture must be visible in the application window when the step runs.
- The area is defined by pairs of coordinates that designate two diagonally opposite corners of a rectangle.
- If the Left, Top, Right, and Bottom arguments are not specified, the method returns all of the text within the visible part of the specified object.
- The results of this method may be different depending on the settings selected in the Text Recognition pane of the Options dialog box (Tools menu > Options item > GUI Testing tab > Text Recognition pane).
- You can use the Text Area Helper and the mouse coordinates displayed on the Change Test Object Image dialog box to help determine the coordinates to use for this method. For more details, see the OpenText Functional Testing User Guide.
Example
Hover Method
Description
Places the pointer on the object.
Syntax
object.Hover [x], [y]
Arguments
Parameter | Description |
---|---|
x |
Optional. An integer value. The x-coordinate of the object that the pointer is placed over. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object. Default value = -9999 |
y |
Optional. An integer value. The y-coordinate of the object that the pointer is placed over. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object. Default value = -9999 |
Return Type
None
IMPORTANT
- The pointer remains placed over the object for the amount of time defined in the Windows hover settings.
- If the coordinates are not provided, the method is performed at the object's ClickPoint. You can view and modify a test object's ClickPoint in the Object Repository, using the Change Test Object Image dialog box. For details, see the OpenText Functional Testing User Guide.
Example
LongClick Method
Description
Presses and holds the left mouse button for a specific number of seconds.
Syntax
object.LongClick [Duration], [x], [y]
Arguments
Parameter | Description |
---|---|
Duration |
Optional. A double floating value. The number of seconds to hold the left mouse button when long-clicking. Default value = 1.10000002384186 |
x |
Optional. An integer value. The x-coordinate of the object to be long-clicked. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object. Default value = -9999 |
y |
Optional. An integer value. The y-coordinate of the object to be long-clicked. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the ClickPoint defined for the selected Insight test object. Default value = -9999 |
Return Type
None
IMPORTANT
If the coordinates are not provided, the method is performed at the object's ClickPoint. You can view and modify a test object's ClickPoint in the Object Repository, using the Change Test Object Image dialog box. For details, see the OpenText Functional Testing User Guide.
Example
Type Method
Description
Types the specified string in the object.
Syntax
object.Type Text, [ClickBeforeType]
Arguments
Parameter | Description |
---|---|
Text |
Required. A String value. The text string to type in the object. |
ClickBeforeType |
Optional. A Boolean value. Specifies whether to click the object to bring it into focus before beginning the type operation. Possible values: Tip: If you want to click a different location in the object before typing, add a step that calls the Click method before the step that calls the Type method. Specify the click coordinates in the Click step, and in the Type step, set the ClickBeforeType parameter to False. Default value = True |
Return Type
None
IMPORTANT
- An Insight test object might represent an object in your application on which a type operation is irrelevant, such as a button or a menu. If you run an InsightObject.Type operation on such an object, the method has no affect.
- During Insight recording, when you type in the application, OpenText Functional Testing records the Type method on the relevant WinObject, and not on the Insight test object. After recording, you can delete this step, and replace it with a Type step performed on the relevant Insight test object.
By default, the InsightObject.Type method clicks the object before typing. Therefore, you can delete any Click steps that were recorded before Type steps.
For example, if the following were recorded:
Insight("ObjectName").Click
Window("WindowName").WinObject("Text").Type "SomeString"
you could change it to:
Insight("ObjectName").Type "SomeString"
Example
TypeSecure Method
Description
Types the encrypted value in the object.
Syntax
object.TypeSecure Text, [ClickBeforeType]
Arguments
Parameter | Description |
---|---|
Text |
Required. A String value. The encrypted text to type in the object. |
ClickBeforeType |
Optional. A Boolean value. Specifies whether to click the object to bring it into focus before beginning the type operation. Possible values: Tip: If you want to click a different location in the object before typing, add a step that calls the Click method before the step that calls the TypeSecure method. Specify the click coordinates in the Click step, and in the TypeSecure step, set the ClickBeforeType parameter to False. Default value = True |
Return Type
None
IMPORTANT
An Insight test object might represent an object in your application on which a type operation is irrelevant, such as a button or a menu. If you run an InsightObject.TypeSecure operation on such an object, the method has no affect.
To find the encrypted value to use as the argument for the TypeSecure method, do one of the following:
Use the Password Encoder utility (available from the Windows Start menu).
Parameterize the argument and use the Data Table encryption option (right-click each unencrypted value in the password column and choose Data > Encrypt).
For more information, see the OpenText Functional Testing Help Center.
While the TypeSecure method enables you to hide passwords on the screen when running a test, it is not intended to be a secure way to protect password information.
Example