AITableCell Object

This object is supported as a technical preview.

Description

An internal object used to perform operations on a table cell identified by AI in web applications.

AITableCell objects are containers. You can access the specific controls inside the AITableCell container and perform operations directly on them.

IMPORTANT

AI objects are supported in UFT One only when:

  • The UFT One Web Add-in is installed and loaded.
  • The UFT One AI Features are installed and AI is enabled in the UFT One options. For details, see the UFT One Help Center.

To retrieve an AITableCell object, use the AITable.Cell property.

Table cell objects are identified using ABBYY OCR.
UFT One 2021 R1 or later: To use AITableCell objects, you must have the ABBYY OCR Engine feature installed in UFT One.

Operations

The sections below list the built-in methods and properties that you can use as operations for the AITableCell object.

Methods

Method CaptureBitmap

Saves a screen capture of the object as a .png or .bmp image using the specified file name.

Supported on UFT One 2021 R1 or later.

Method CheckExists

A checkpoint that checks whether the object currently exists in the set context.

Method Click

Clicks the cell.

Method DoubleClick

Double-clicks the AI text object.

Supported on UFT One 2021 R1 or later.

Method GetText

Retrieves the cell's text.

Method Highlight

Highlights the object in the application.

Method LongClick

Presses and holds the AI text object for a specified number of seconds.

Supported on UFT One 2021 R1 or later.

Method MultiClick

Clicks the AI text object the specified number of times.

Supported on UFT One 2021 R1 or later.

Method RightClick

Right-clicks the AI text object.

Supported on UFT One 2021 R1 or later.

Method SetText

Sets the value of the cell.

Relevant for cells containing text boxes, input controls, and combo boxes.

Supported on UFT One 2021 R1 or later.

Method SetTextSecure

Sets the encoded value of the cell.

Relevant for cells containing text boxes, input controls, and combo boxes.

Supported on UFT One 2021 R1 or later.

Method TypeTypes the specified string in the current cell.
Method TypeSecureTypes the specified encoded string in the current cell.

Properties

Property AIObjectCreates an AIObject for the specified control found inside the container.
Common Property ExistChecks whether the object currently exists in the set context.
Property FindTextCreates an AITextObject for the specified text found inside the container.
Property FindTextBlockCreates an AITextObject for the specified text block found inside the container.

Back to top

 

CaptureBitmap Method

Supported on UFT One 2021 R1 or later.

Description

Saves a screen capture of the object as a .png or .bmp image using the specified file name.

Syntax

AIUtil.Table.Cell(Column, Row).CaptureBitmap  FullFileName, [OverrideExisting]

Arguments

ParameterDescription
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

Examples

Back to top

 

CheckExists Method

Description

A checkpoint that checks whether the object currently exists in the set context.

Syntax

AIUtil.Table.Cell(Column, Row).CheckExists expected

Arguments

ParameterDescription
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.

  • UFT One 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

Back to top

 

Click Method

Description

Clicks the cell.

Syntax

AIUtil.Table.Cell(Column, Row).Click 

Return Type

None

Example

Back to top

 

DoubleClick Method

Supported on UFT One 2021 R1 or later.

Description

Double-clicks the cell.

Syntax

AIUtil.Table.Cell(Column, Row).DoubleClick  [x], [y]

Arguments

ParameterDescription
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

Back to top

 

GetText Method

Description

Retrieves the cell's text.

Syntax

AIUtil.Table.Cell(Column, Row).GetText 

Return Type

None

Example

Back to top

 

Highlight Method

Description

Highlights the object in the application.

Syntax

AIUtil.Table.Cell(Column, Row).Highlight

Return Type

None

Example

Back to top

 

LongClick Method

Supported on UFT One 2021 R1 or later.

Description

Presses and holds the cell for a specified number of seconds.

Syntax

AIUtil.Table.Cell(Column, Row).LongClick [duration], [x], [y]

Arguments

ParameterDescription
duration

Optional. A double float 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

IMPORTANT

The LongClick method is not supported on mobile applications.

Example

Back to top

 

MultiClick Method

Supported on UFT One 2021 R1 or later.

Description

Clicks the cell the specified number of times.

Syntax

AIUtil.Table.Cell(Column, Row).MultiClick [numberOfClicks ], [interval], [x], [y]

Arguments

ParameterDescription
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

Back to top

RightClick Method

Supported on UFT One 2021 R1 or later.

Description

Right-clicks the cell.

Syntax

AIUtil.Table.Cell(Column, Row).RightClick [x], [y]

Arguments

ParameterDescription
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

Back to top

 

SetText Method

Description

Sets the value of the cell.

Syntax

AIUtil.Table.Cell(Column, Row).SetText  [text]

Arguments

ParameterDescription
text Required. A String value.
The string to set in the cell.

Return Type

None

IMPORTANT

  • This method is relevant for cells that contain text boxes, input controls, and combo boxes.

  • This method is not supported for mobile applications.

Example

Back to top

SetTextSecure Method

Description

Sets the encoded value of the cell.

Syntax

AIUtil.Table.Cell(Column, Row).SetTextSecure  [encodedText]

Arguments

ParameterDescription
encodedText Required. A String value.
The encoded string to set in the cell.

Return Type

None

IMPORTANT

  • This method is relevant for cells that contain text boxes, input controls, and combo boxes.

  • This method is not supported for mobile applications.

  • To find the encoded value to use as the argument for the SetTextSecure method, use the Password Encoder utility (Start > All Programs > Micro Focus > Micro Focus UFT One > 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 UFT One 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

Back to top

 

Type Method

Description

Types the specified string in the current cell.

Syntax

AIUtil.Table.Cell(Column, Row).Type  [text]

Arguments

ParameterDescription
text Required. A String value.
The string to type.

Return Type

None

Example

Back to top

 

TypeSecure Method

Description

Types the specified encoded string in the current cell.

Syntax

AIUtil.Table.Cell(Column, Row).TypeSecure  [text]

Arguments

ParameterDescription
text Required. A String value.
The encrypted string to type.

Return Type

None

IMPORTANT

To find the encoded value to use as the argument for the TypeSecure method, use the Password Encoder utility (Start > All Programs > Micro Focus > Micro Focus UFT One > 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 UFT One Help Center.

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

 

AIObject Property

Description

Creates an AIObject Object for the specified control. The control can be specified by type, and for some control types, by the object text.

If there are multiple similar objects in the cell, use the object's relative location in the cell to describe it uniquely.

Syntax

AIUtil.Table.Cell(Column, Row).AIObject ControlType, [AIText], [locator], [locatorData]

Arguments

ParameterDescription
ControlType Required. A String value.
The type of the control. For a list of supported control types, see the UFT One Help Center.
AIText

Optional. A String value.
The text to use to identify the control. For a list of control types that support recognition by text, see the UFT One Help Center.
Enter the micAnyText constant if you want to ignore this parameter and provide values for locator and locatorData.

locator

Optional. A predefined constant or string value. Mandatory if you specify a value for the locatorData parameter.

Used to describe the unique location of an object that may appear multiple times in the cell. The location can be ordinal, relative to similar objects in the cell, or proximal, relative to a different AI object, considered an anchor.

  • For ordinal location, the locator represents the direction in which to count.

    Possible values: 
    Strings: "FromTop""FromLeft", "FromRight", "FromBottom".
    Constant values: micFromTopmicFromLeft, micFromRight, micFromBottom.

  • For proximity to a different AI object, the locator represents the direction of the anchor object.
    Possible values: 
    Strings: "WithAnchorOnLeft", "WithAnchorOnRight", "WithAnchorAbove", "WithAnchorBelow".
    Constant values: micWithAnchorOnLeft, micWithAnchorOnRight, micWithAnchorAbove ,micWithAnchorBelow.
locatorData

Optional. An Integer value or an AI object. Mandatory if you specify a value for the locator parameter.

  • For ordinal location, the locatorData provides the ordinal number of the object, starting with 1 for the first object.
    UFT One counts the objects that match the description, in the direction specified in the locator parameter.
  • For proximity to a different AI object, the locatorData specifies the AI object to use as an anchor.
    The anchor must be an AI object (AITextObject Object or AIObject Object) that belongs to the same context as the object you are describing.
    The anchor can also be described by its location.
    UFT One returns the AI object that matches the description and is closest and most aligned with the anchor, in the specified direction.

Return Type

An AIObject Object.

Example

Back to top

 

Exist Property

Description

Checks whether the object currently exists in the set context.

Syntax

AIUtil.Table.Cell(Column, Row).Exist([TimeOut])

Arguments

ParameterDescription
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.

  • If a timeout value is specified, UFT One waits until it finds the object or until the timeout is reached.

  • If no value is specified, the value specified in the Test Settings dialog box for the Object Synchronization Timeout is used for tests. For business components, the pre-defined value of 20 seconds is used.

Note: A value of 0 is not supported for Mobile test objects.

For more information on the Object Synchronization Timeout, see the UFT One 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.

  • UFT One 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

Back to top

 

FindText Property

Description

Creates an AITextObject Object for the specified text. This may be partial text within a larger block of text.

If there are multiple similar objects in the cell, use the object's relative location in the cell to describe it uniquely.

Syntax

AIUtil.Table.Cell(Column, Row).FindText AIText, [locator], [locatorData]

Arguments

ParameterDescription
AIText

Required. A String value.
The text to find.

Enter the micAnyText constant if you want to ignore this parameter and provide values for locator and locatorData. This is useful when you want to identify an object by its location and later retrieve the text from the object.

locator

Optional. A predefined constant or string value. Mandatory if you specify a value for the locatorData parameter.

Used to describe the unique location of an object that may appear multiple times in the cell. The location can be ordinal, relative to similar objects in the cell, or proximal, relative to a different AI object, considered an anchor.

  • For ordinal location, the locator represents the direction in which to count.

    Possible values: 
    Strings: "FromTop""FromLeft", "FromRight", "FromBottom".
    Constant values: micFromTopmicFromLeft, micFromRight, micFromBottom.

  • For proximity to a different AI object, the locator represents the direction of the anchor object.
    Possible values: 
    Strings: "WithAnchorOnLeft", "WithAnchorOnRight", "WithAnchorAbove", "WithAnchorBelow".
    Constant values: micWithAnchorOnLeft, micWithAnchorOnRight, micWithAnchorAbove ,micWithAnchorBelow.
locatorData

Optional. An Integer value or an AI object. Mandatory if you specify a value for the locator parameter.

  • For ordinal location, the locatorData provides the ordinal number of the object, starting with 1 for the first object.
    UFT One counts the objects that match the AIText parameter, in the direction specified in the locator parameter.
  • For proximity to a different AI object, the locatorData specifies the AI object to use as an anchor.
    The anchor must be an AI object (AITextObject Object or AIObject Object) that belongs to the same context as the object you are describing.
    The anchor can also be described by its location.
    UFT One returns the AI object that matches the AIText parameter and is closest and most inline with the anchor, in the specified direction.

Return Type

An AITextObject Object.

Example

Back to top

FindTextBlock Property

Description

Creates an AITextObject Object for the specified text block.

If there are multiple similar objects in the cell, use the object's relative location in the cell to describe it uniquely.

Syntax

AIUtil.Table.Cell(Column, Row).FindTextBlock AIText, [locator], [locatorData]

Arguments

ParameterDescription
AIText

Required. A String value.
The text block to find.

Enter the micAnyText constant if you want to ignore this parameter and provide values for locator and locatorData. This is useful when you want to identify an object by its location and later retrieve the text from the object.

locator

Optional. A predefined constant or string value. Mandatory if you specify a value for the locatorData parameter.

Used to describe the unique location of an object that may appear multiple times in the cell. The location can be ordinal, relative to similar objects in the cell, or proximal, relative to a different AI object, considered an anchor.

  • For ordinal location, the locator represents the direction in which to count.

    Possible values: 
    Strings: "FromTop""FromLeft", "FromRight", "FromBottom".
    Constant values: micFromTopmicFromLeft, micFromRight, micFromBottom.

  • For proximity to a different AI object, the locator represents the direction of the anchor object.
    Possible values: 
    Strings: "WithAnchorOnLeft", "WithAnchorOnRight", "WithAnchorAbove", "WithAnchorBelow".
    Constant values: micWithAnchorOnLeft, micWithAnchorOnRight, micWithAnchorAbove ,micWithAnchorBelow.
locatorData

Optional. An Integer value or an AI object. Mandatory if you specify a value for the locator parameter.

  • For ordinal location, the locatorData provides the ordinal number of the object, starting with 1 for the first object.
    UFT One counts the objects that match the AIText parameter, in the direction specified in the locator parameter.
  • For proximity to a different AI object, the locatorData specifies the AI object to use as an anchor.
    The anchor must be an AI object (AITextObject Object or AIObject Object) that belongs to the same context as the object you are describing.
    The anchor can also be described by its location.
    UFT One returns the AI object that matches the AIText parameter and is closest and most inline with the anchor, in the specified direction.

Return Type

An AITextObject Object.

Example

Back to top