AIRunSettings Object

Description

An object containing the settings for the current test run. These settings enable you to modify test settings during the test run, overriding the global settings defined in Tools > Options > GUI Testing > AI.

IMPORTANT

AI-based testing is supported on the following technologies:

Web, mobile, and SAP GUI for Windows.

AI objects are supported in UFT One only when:

  • The UFT One Web Add-in, Mobile Add-in, or SAP Solutions 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 AIRunSettings object, use the AIUtil.RunSettings property.

The settings in an AIRunSettings object are arranged in child objects, each for a different type of settings. Use the relevant object property to retrieve the child settings objects.

Properties

The following table lists the built-in properties that you can use to access the settings child objects.

Property AIServiceMode

Indicates whether the AI Service is accessed locally or remotely.

Syntax

AIUtil.RunSettings.AIServiceMode

Property AutoScroll

Returns the AIRunSettingsAutoScroll object to use for the current test run.

Syntax

AIUtil.RunSettings.AutoScroll

PropertyComboBoxSelect

Returns the AIRunSettingsComboBoxSelect object to use for the current test run.

Syntax

AIUtil.RunSettings.ComboBoxSelect

Property OCR

Returns the AIRunSettingsOCR object to use for the current test run.

Syntax

AIUtil.RunSettings.OCR

Property VerifyIdentification

Returns the AIRunSettingsVerifyIdentification object to use for the current test run.

Syntax

AlUtil.RunSettings.VerifyIdentification

Property TextMatch

A String value. Specifies whether to look for the specified text exactly when identifying AI test objects, or use AI algorithms to find similar text as well.

Back to top

AIServiceMode Property

Description

Indicates whether the AI Service is accessed locally or remotely

.

An Integer or predefined value.

Syntax

AIUtil.RunSettings.AIServiceMode

Possible values

  • 0 or Local_AI. Use the local AI service. (Default)

  • 1 or Remote_AI. Use a remote AI service.

Back to top

AIRunSettingsAutoScroll Object

Description

Controls automatic scrolling for AI object identification in the current test run.

By default, the automatic scrolling is on, and set to scroll down, up to 2 times.

Important

To retrieve an AIRunSettingsAutoScroll object, use the AIUtil.RunSettings.AutoScroll property.

Methods

The following table lists the methods you can call to control the run time AutoScroll settings:

Method Disable

Disables automatic scrolling for AI object identification in the current test run.

Syntax

AIUtil.RunSettings.AutoScroll.Disable

Method Enable

Enables and configures automatic scrolling for AI object identification in the current test run.

Syntax

AIUtil.RunSettings.AutoScroll.Enable scrolldirection, [maxNumberOfScrolls]

Arguments

  • scrolldirection. The direction in which to scroll.

    Possible values: up, down, right, left.

  • maxNumberOfScrolls. Optional. The maximum number of times to scroll in search of the object.

    Tip: If you do not specify a number, or you enter -1, the scroll direction is updated and the maximum number setting remains unchanged.

Method GetDirection

Retrieves the direction used for automatic scrolling.

Syntax

AIUtil.RunSettings.AutoScroll.GetDirection

Possible values:

up, down, right, left.

Method GetMaxNumOfScrolls

Retrieves the maximum number of scrolls used for automatic scrolling.

Syntax

AIUtil.RunSettings.AutoScroll.GetMaxNumOfScrolls

Property IsEnabled

Indicates whether automatic scrolling is enabled.

Syntax

AIUtil.RunSettings.AutoScroll.IsEnabled

Possible values:

  • True

  • False

Back to top

AIRunSettingsComboBoxSelect Object

Description

Controls a combo box's AI-based Select operation.

By default, when looking for the item to select in a combo box's list, UFT One is set to scroll down, up to 10 times.

Important

  • To retrieve an AIRunSettingsComboBoxSelect object, use the AIUtil.RunSettings.ComboBoxSelect property.

  • The AI-based Select operation is supported only on non-mobile applications, and is used when the combo box is not identified as a WebList.

Properties

The following table lists the properties that represent the run time ComboBoxSelect settings:

Method MaxScrollNum

An Integer. Specifies the maximum number of times to scroll in the ComboBox's drop-down list.

Default: 10

Method ScrollingDirection

A String. Specifies whether to scroll up or down in the ComboBox's drop-down list.

Possible values: "down", "up".

Default: down

Method TicksPerScroll

Specifies how many mouse-wheel ticks each scroll advances.

Default: 1

Back to top

AIRunSettingsOCR Object

Description

Specifies the OCR settings to use in the current test run.

By default, only English text is identified.

Important

To retrieve an AIRunSettingsOCR object, use the AIUtil.RunSettings.OCR property.

Properties

The following table lists the properties that represent the run time OCR settings:

MethodConsiderUIControlBorders

Returns the ConsiderUIControlBorders setting to use for the current test run.

This setting specifies whether to take UI control borders into account when dividing up identified text. This setting is enabled by default.

You can use the following methods to control the ConsiderUIControlBorders setting:

Enable. Enables taking UI control borders into account.

Disable. Disables taking UI control borders into account.

IsEnabled Indicates whether taking UI control borders into account is enabled.

Syntax

AIUtil.RunSettings.ConsiderUIControlBorders.IsEnabled

Possible values:

  • True

  • False

Method GetConfigSet

A number or predefined constant. Indicates which OCR engine and settings are used.

Possible values

  • 0 or AI_OCR. Use the default AI OCR engine and the languages defined in the Languages property.

  • 1 or UFT_OCR. Use UFT OCR settings.

Property Languages

A String. A comma-separated list of the OCR languages to use in the test run.

Relevant if GetConfigSet=AI_OCR.

Syntax

AIUtil.RunSettings.OCR.Languages

Possible values:

en – English

af – Afrikaans

eu – Basque

ca – Catalan

hr – Croatian

cs – Czech

da – Danish

nl – Dutch

eo – Esperanto

et – Estonian

fi – Finnish

fr – French

de – German

hu – Hungarian

is – Icelandic

it – Italian

ga – Irish

la – Latin

lv – Latvian

lt – Lithuanian

mt – Maltese

no – Norwegian

pl – Polish

pt – Portuguese

ro – Romanian

sk – Slovak

sl – Slovenian

es – Spanish

sv – Swedish

tr – Turkish

cy – Welsh

ar – Arabic

zhs – Simplified Chinese

zht – Traditional Chinese

bg – Bulgarian

mk – Macedonian

ru – Russian

sr – Serbian

uk – Ukrainian

el – Greek

he – Hebrew

ja – Japanese

ko – Korean

If any other language is specified, English is used instead.

MethodTrimNoise

Returns the TrimNoise setting to use for the current test run.

This setting specifies whether to remove noise characters from identified text. Noise characters are any characters identified in unexpected areas or controls. This setting is enabled by default.

You can use the following methods to control the TrimNoise setting:

Enable. Enables noise removal.

Disable. Disables noise removal.

IsEnabled Indicates whether noise removal is enabled.

Syntax

AIUtil.RunSettings.TrimNoise.IsEnabled

Possible values:

  • True

  • False

Method UseConfigSet

A number or predefined constant. Specifies which OCR engine and settings to use.

Possible values: 

  • 0 or AI_OCR. Use the default AI OCR engine and the languages defined in the Languages property.

  • 1 or UFT_OCR. Use UFT OCR settings.

Back to top

AIRunSettingsVerifyIdentification Object

Description

Controls whether to verify the AI object identification before performing the operation in the current test run.

Important

To retrieve an AIRunSettingsVerifyIdentification object, use the AlUtil.RunSettings.VerifyIdentification property.

Methods

The following table lists the methods you can call to control the identification verification settings:

Method Disable

Disables verifying AI object identification in the current test run.

Syntax

AIUtil.RunSettings.VerifyIdentification.Disable

Note

This disables identification verification for both Web and Mobile contexts.

Method Enable

Enables verifying AI object identification in the current test run.

Syntax

AIUtil.RunSettings.VerifyIdentification.Enable

Note

This enables identification verification for both Web and Mobile contexts.

Property IsEnabled

Indicates whether AI object identification is verified before performing operations.

Syntax

AIUtil.RunSettings.VerifyIdentification.IsEnabled

Possible values

True - Identification verification is enabled for at least one of the contexts Web or Mobile.

False - Identification verification is disabled for both Web and Mobile.

Back to top

TextMatch Property

Description

Specifies whether to look for the specified text exactly when identifying AI test objects, or use AI algorithms to find similar text as well.

Syntax

AIUtil.RunSettings.TextMatch

Possible values: micExactMatch, micAIMatch

Remarks

  • By default, AI algorithms are used for text matching. If you set this property to micExactMatch in a test run, we recommend limiting it to specific steps and then setting back to micAIMatch.
  • When using regular expression matching with micAIMatch, a certain level of deviation from the specified text pattern is accepted. For example, the pattern "Subtotal \(\d item\): \$[\d.]+" will pick up the price string even if it says "items" in plural or "Subt0tal" with a '0' instead of an 'o'.
  • Exact match is case-insensitive.

Back to top

See also: