AIObject Object

This object is provided as a technical preview.

Description

An internal object used to perform operations on an object recognized using AI.

AI objects are supported in UFT only when the UFT Web Add-in and Mobile add-in are installed and loaded.

IMPORTANT

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.

Method Click Clicks the object.
Method Exist Checks whether the object currently exists in the set context.
Method Highlight Highlights the object in the application.
Method Search

Performs a search operation using an AIObject of type “Search”.

Method SetState Sets the state of a check box or toggle button to On or Off.
Method Type Types the specified string in the object.
Method TypeSecure Types the specified encrypted string in the object.

Back to top

 

Click Method

Description

Clicks the object.

Syntax

AIUtil.AIObject(ControlType, [text]).Click  [x], [y]

or

AIUtil(ControlType, [text]).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

Back to top

 

Exist Method

Description

Checks whether the object currently exists in the set context.

Syntax

AIUtil.AIObject(ControlType, [text]).Exist

or

AIUtil(ControlType, [text]).Exist

Note: You can omit the AIObject property in the syntax, because AIObject is the default property for the AIUtil object.

Return Type

A Boolean value indicating whether the object exists.

Example

Back to top

 

Highlight Method

Description

Highlights the object in the application.

Syntax

AIUtil.AIObject(ControlType, [text]).Highlight

or

AIUtil(ControlType, [text]).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

Back to top

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

Back to top

SetState Method

Description

Sets the state of a check box or toggle button to On or Off.

Syntax

AIUtil.AIObject(ControlType, [text]).SetState  State

or

AIUtil(ControlType, [text]).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.
The state to set.

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

Back to top

 

Type Method

Description

Types the specified string in the object.

Syntax

AIUtil.AIObject(ControlType, [text]).Type  [text]

or

AIUtil(ControlType, [text]).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

Back to top

 

TypeSecure Method

Description

Types the specified encrypted string in the object.

Syntax

AIUtil.AIObject(ControlType, [text]).TypeSecure  [text]

or

AIUtil(ControlType, [text]).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 encrypted string to type.

Return Type

None

IMPORTANT

To find the encrypted value to use as the argument for the TypeSecure method, use the Password Encoder utility (Start > All Programs > Unified Functional Testing > Tools > Password Encoder) or 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 Unified Functional Testing Help.

Note: 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

Back to top