AIObject Object
Description
An internal object used to perform operations on an object identified using AI.
IMPORTANT
AI-based testing is supported on the following technologies:
Web, mobile, and SAP GUI for Windows.
AI objects are supported in only when:
- The Web Add-in, Mobile Add-in, or SAP Solutions Add-in is installed and loaded.
- The AI Object Detection feature is installed and enabled in the OpenText Functional Testing options. For details, see the OpenText Functional Testing Help Center.
To retrieve an AIObject object, use the AIUtil.AIObject default property.
Operations
The sections below list the built-in methods and properties that you can use as operations for the AIObject object.
Note: You can also view a list and descriptions of the AIObject properties that you can retrieve using the GetObjectProperty and GetAllProperties methods. You can then use the properties to check the object's location or content.
Methods
![]() | Saves a screen capture of the AIObject as a .png or .bmp image using the specified file name. |
![]() | A checkpoint that checks whether the object currently exists in the set context. |
![]() | A checkpoint that checks the state of the object. |
![]() | Clicks the AI object. |
![]() | Double-clicks the AI object. |
![]() | Retrieves all of the AIObject's properties and their values from the application. |
![]() | Retrieves the value of the specified object property from the application. |
![]() | Retrieves the object's value. |
![]() | Highlights the object in the application. |
![]() | Holds the cursor over the object. |
![]() | Presses and holds the AI object for a specified number of seconds. |
![]() | Clicks the AI object the specified number of times. |
![]() | Right-clicks the AI object. |
![]() | Performs a search operation using an AIObject of type “Search”. |
![]() | Selects an item from a combo box. |
![]() | Sets the state of a check box or toggle button to On or Off. |
![]() | Sets the value of the object. Relevant for text boxes, input controls, and combo boxes. |
![]() | Sets the encoded value of the object. Relevant for text boxes, input controls, and combo boxes. |
![]() | Types the specified string in the object. |
![]() | Types the specified encoded string in the object. |
Properties
![]() | Checks whether the object currently exists in the set context. |
CaptureBitmap Method
Description
Saves a screen capture of the object as a .png or .bmp image using the specified file name.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).CaptureBitmap FullFileName, [OverrideExisting]
Or
AIUtil(ControlType, [text], [locator], [locatorData]).CaptureBitmap FullFileName, [OverrideExisting]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
FullFileName | Required. A String value. The path to the file to store the screen capture. The file extension indicates whether to save the capture as a .png or .bmp file. |
OverrideExisting | Optional. A Boolean value. Indicates what to do if a file by the specified name already exists: True: Replace the existing file with the new capture. False (Default): The step fails if a file by the specified name already exists. |
Return Type
None
Example
CheckExists Method
Description
A checkpoint that checks whether the object currently exists in the set context.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).CheckExists expected
Or
AIUtil(ControlType, [text], [locator], [locatorData]).CheckExists expected
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
expected | A Boolean value. Specifies whether this checkpoint expects the object to exist. Possible values: true. The checkpoint passes if the object is found within the set context before the timeout expires. false. The checkpoint passes if the object is not found by the time the timeout expires. |
Remarks
This method uses the timeout defined in the Object Synchronization Timeout option in the Run pane of the Test Settings dialog box.
OpenText Functional Testing directly performs this method without verifying object identification even if you enable it in Options > GUI Testing > AI or use the AIUtil.RunSettings.VerifyIdentification.Enable step.
Return Type
A Boolean value.
Returns TRUE if the checkpoint passes, otherwise FALSE.
A TRUE return value reports a Passed step to the run results; a FALSE return value reports a Failed step to the run results.
Example
CheckState Method
Description
A checkpoint that checks the state of the object.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).CheckState expectedState
Or
AIUtil(ControlType, [text], [locator], [locatorData]).CheckState expectedState
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
expectedState | A String value. Specifies the expected state of an object such as check box, radio button, or toggle. Possible values: On. The checkpoint passes if the object's state is ON. Off. The checkpoint passes if the object's state is OFF. Note: The state check is case insensitive. |
Return Type
A Boolean value.
Returns TRUE if the checkpoint passes, otherwise FALSE.
A TRUE return value reports a Passed step to the run results; a FALSE return value reports a Failed step to the run results.
Example
Click Method
Description
Clicks the AI object.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).Click [x], [y]
or
AIUtil(ControlType, [text], [locator], [locatorData]).Click [x], [y]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
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 middle of the object (-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 middle of the object (-9999). |
Return Type
None
Example
DoubleClick Method
Description
Double-clicks the AI object.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).DoubleClick [x], [y]
or
AIUtil(ControlType, [text], [locator], [locatorData]).DoubleClick [x], [y]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
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. The default value is the middle of the object (-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. The default value is the middle of the object (-9999). |
Return Type
None
IMPORTANT
The DoubleClick method is not supported on mobile applications.
Example
GetAllProperties Method
Description
Retrieves all of the AIObject's properties and their values from the application.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).GetAllProperties
Or
AIUtil(ControlType, [text], [locator], [locatorData]).GetAllProperties
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Return Type
A Dictionary object
Example
GetObjectProperty Method
Description
Retrieves the value of the specified object property from the object in the application.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).GetObjectProperty (property)
Or
AIUtil(ControlType, [text], [locator], [locatorData]).GetObjectProperty (property)
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
property | Required. A String. The name of the property whose value to return. |
Return Type
A Variant.
Example
GetValue Method
Description
Returns the object's value.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).GetValue
Or
AIUtil(ControlType, [text], [locator], [locatorData]).GetValue
Return Type
A string. A Boolean value.
Example
Highlight Method
Description
Highlights the object in the application.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).Highlight
or
AIUtil(ControlType, [text], [locator], [locatorData]).Highlight
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Return Type
None
Example
Hover Method
Description
Holds the cursor over the object.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).Hover [duration]
or
AIUtil(ControlType, [text], [locator], [locatorData]).Hover [duration]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
duration |
Optional. An Integer value. The whole number of seconds to hold the cursor over the object. Default: 2 seconds. |
Return Type
None
IMPORTANT
This method is supported only on Web applications running in a Web browser on a Desktop computer and not on mobile devices.
Before a Hover step, use the AIUtil.IsMobileContext to make sure the current AI context is a desktop web browser.
Designing your test this way makes it easier to use the same test for your web application on various platforms.
Example
LongClick Method
Description
Presses and holds the AI object for a specified number of seconds.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).LongClick [duration], [x], [y]
or
AIUtil(ControlType, [text], [locator], [locatorData]).LongClick [duration], [x], [y]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
duration | Optional. A double floating value. The number of seconds to press the object. Default: 2 seconds |
x |
Optional. An integer value. The x-coordinate of the long click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the middle of the object (-9999). |
y |
Optional. An integer value. The y-coordinate of the long click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the middle of the object (-9999). |
Return Type
None
Example
MultiClick Method
Description
Clicks the AI object the specified number of times.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).MultiClick [numberOfClicks ], [interval], [x], [y]
or
AIUtil(ControlType, [text], [locator], [locatorData]).MultiClick [numberOfClicks ], [interval], [x], [y]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
numberOfClicks | Required. An integer value. The number of times to click. |
interval | Optional. A double floating value. The number of seconds between clicks. The default value is 0.5 seconds. |
x |
Optional. An integer value. The x-coordinate of the clicks. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the middle of the object (-9999). |
y |
Optional. An integer value. The y-coordinate of the clicks. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the middle of the object (-9999). |
Return Type
None
Example
RightClick Method
Description
Right-clicks the AI object.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).RightClick [x], [y]
or
AIUtil(ControlType, [text], [locator], [locatorData]).RightClick [x], [y]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
x |
Optional. An integer value. The x-coordinate of the long click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the middle of the object (-9999). |
y |
Optional. An integer value. The y-coordinate of the long click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the middle of the object (-9999). |
Return Type
None
IMPORTANT
The RightClick method is not supported on mobile applications.
Example
Search Method
Description
Performs a search operation using an AIObject of type “Search”.
Syntax
AIUtil.AIObject("Search").Search [text]
or
AIUtil("Search").Search [text]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
text |
Required. A String value. The string to enter in the search box. |
Return Type
None
IMPORTANT
The Search method is supported only for AIObjects of type "Search". The method enters the specified string in the search box and presses Enter.
Example
Select Method
Description
Selects an item from a combo box.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).Select Item
or
AIUtil(ControlType, [text], [locator], [locatorData]).Select Item
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
Item |
Required. A String value. |
Return Type
None.
IMPORTANT
Mobile testing: | The Select action is supported on a combo box identified by AI only if OpenText Functional Testing can also identify the combo box as a MobileDropDown. |
Non-mobile testing: | OpenText Functional Testing first tries to identify the combo box as a WebList, as the select operation is most efficient when using the object's native commands. Otherwise, OpenText Functional Testing uses the AI capabilities to support the Select operation. In this case, the operation is affected by the AIRunSettings.ComboBoxSelect settings. These runtime settings tell OpenText Functional Testing how far and in which direction to scroll the combo box's list in search of the specified value. The AI-based Select operation is supported on combo boxes with a single-column drop-down list that opens by clicking the box. |
Example
SetState Method
Description
Sets the state of a check box or toggle button to On or Off.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).SetState State
or
AIUtil(ControlType, [text], [locator], [locatorData]).SetState State
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
State |
Required. A String value. Possible values: On, Off (case-insensitive) |
Return Type
None.
IMPORTANT
This method is supported for ControlType Toggle, Check box, and Radio button.
A radio button object represents one button in a radio group. Therefore, SetState on a radio button can only set the button to On. To set a radio button to Off, you must use SetState to set a different radio button in the group to On.
Example
SetText Method
Description
Sets the value of the object.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).SetText [text]
or
AIUtil(ControlType, [text], [locator], [locatorData]).SetText [text]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
text |
Required. A String value. The string to set in the object. |
Return Type
None
IMPORTANT
This method is relevant for AIObjects that represent text boxes, input controls, and combo boxes.
On mobile devices, this method is supported only on native apps.
Example
SetTextSecure Method
Description
Sets the encoded value of the object.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).SetTextSecure [encodedText]
or
AIUtil(ControlType, [text], [locator], [locatorData]).SetTextSecure [encodedText]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
encodedText |
Required. A String value. The encoded string to set in the object. |
Return Type
None
IMPORTANT
This method is relevant for AIObjects that represent text boxes, input controls, and combo boxes.
On mobile devices, this method is supported only on native apps.
To find the encoded value to use as the argument for the SetTextSecure 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.
Note: While the SetTextSecure 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
Type Method
Description
Types the specified string in the object.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).Type [text]
or
AIUtil(ControlType, [text], [locator], [locatorData]).Type [text]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
text |
Required. A String value. The string to type. |
Return Type
None
Example
TypeSecure Method
Description
Types the specified encoded string in the object.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).TypeSecure [text]
or
AIUtil(ControlType, [text], [locator], [locatorData]).TypeSecure [text]
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
text |
Required. A String value. The encoded string to type. |
Return Type
None
IMPORTANT
To find the encoded 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
Exist Property
Description
Checks whether the object currently exists in the set context.
Syntax
AIUtil.AIObject(ControlType, [text], [locator], [locatorData]).Exist([TimeOut])
or
AIUtil(ControlType, [text], [locator], [locatorData]).Exist([TimeOut])
Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.
Arguments
Parameter | Description |
---|---|
TimeOut | Optional. An unsigned long integer value. The length of time (in seconds) to search for the object before returning a True or False value.
Note: A value of 0 is not supported for Mobile test objects. For more information on the Object Synchronization Timeout, see the OpenText Functional Testing Help Center. |
Return Type
A Boolean value indicating whether the object exists.
Remarks
The Exist property can only be used in statements that use its return value. For example, assignment, print, and if statements.
OpenText Functional Testing directly performs this method without verifying object identification even if you enable it in Options > GUI Testing > AI or use the AIUtil.RunSettings.VerifyIdentification.Enable step.
Example
See also: