AiObject

AI. AiObject

new AiObject(propsopt) → {AiObject}

The description of an object identified using Artificial Intelligence.

Parameters:

NameTypeAttributesDescription
propsObject <optional>
Initializes a description of an object identified using Artificial Intelligence. using the supplied property bag.

Returns:

the description object that was initialized.
Type
AiObject

Methods

aiClass(aiClassopt) → {string|Description}

the AI Class type of the AI object list of supported classes can be taken from AI.AiTypes.

Parameters:

NameTypeAttributesDescription
aiClassstring <optional>
When provided, this method acts as a setter and sets the aiClass value.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored aiClass value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

locator(locatoropt) → {object|Description}

Used to describe the unique location of an object that may appear multiple times in the application.

Parameters:

NameTypeAttributesDescription
locatorobject <optional>

When provided, this method acts as a setter and sets the locator value.

Properties

UFT Developer 2022 and later:  Should be either AI.PositionalLocator or AI.RelationalLocator.

UFT Developer 2021 R1 and earlier: 

NameTypeAttributesDescription
directionstring <optional>
The direction of the AI object, can be either: fromLeft, fromRight, fromTop or fromBottom.
indexnumber <optional>
The 0-based index from the given direction of the AI object.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored locator value; otherwise it returns 'this' for use with the builder pattern.
Type
object | Description

text(textopt) → {string|Description}

The object's attached text.

Parameters:

NameTypeAttributesDescription
textstring <optional>
When provided, this method acts as a setter and sets the text value.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored text value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description