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 objects are supported in UFT One only when:
- The UFT One Web Add-in or Mobile Add-in are 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.
![]() | Returns the AIRunSettingsAutoScroll object to use for the current test run. Syntax AIUtil.RunSettings.AutoScroll |
![]() | Returns the AIRunSettingsOCR object to use for the current test run. Syntax AIUtil.RunSettings.OCR |
![]() | Returns the AIRunSettingsVerifyIdentification object to use for the current test run. Syntax AlUtil.RunSettings.VerifyIdentification |
![]() | 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. |
AIRunSettingsAutoScroll Object
Description
Controls automatic scrolling for AI 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:

'The following example scrolls down (based on the default settings) to highlight
' the SEE OFFER button, and then scrolls back up to highlight the SPEAKERS text
' Before changing the scroll direction, this example saves the original scroll settings
' and restores them after highlighting the required object
AIUtil.SetContext Browser("creationtime:=0")
Browser("creationtime:=0").Navigate "https://www.advantageonlineshopping.com"
AIUtil("button", "SEE OFFER").highlight
WasEnabled = AIUtil.RunSettings.AutoScroll.IsEnabled
OrigDirection = AIUtil.RunSettings.AutoScroll.GetDirection
OrigMax = AIUtil.RunSettings.AutoScroll.GetMaxNumberOfScrolls
AIUtil.RunSettings.AutoScroll.Enable "up", 2
AIUtil.FindTextBlock("SPEAKERS").highlight
If WasEnabled Then
AIUtil.RunSettings.AutoScroll.Enable OrigDirection, OrigMax
Else
AIUtil.RunSettings.AutoScroll.Disable
End If
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:

'If the OCR settings in use are the AI OCR settings, this example
'changes the settings for this run, to detect both English and French texts when using OCR.
If AIUtil.RunSettings.OCR.GetConfigSet = AI_OCR Then
AIUtil.RunSettings.Ocr.Languages="en, fr"
End If
AIUtil.FindTextBlock("Se connecter en toute sécurité").Click
AIRunSettingsVerifyIdentification Object
Description
Controls whether to verify the AI 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:

'This examples instructs UFT One to double check if the ADD TO CART text block exists
'before clicking on the text.
'The example saves the original run setting and restores it after
' clicking the required text.
WasEnabled =AIUtil.RunSettings.VerifyIdentification.IsEnabled
AIUtil.RunSettings.VerifyIdentification.Enable
AIUtil.FindTextBlock("ADD TO CART").Click
If Not WasEnabled Then
AIUtil.RunSettings.VerifyIdentification.Disable
End If
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.
Snytax
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.
- Exact match is case-insensitive.

'The following example instructs UFT to look for an exact match for "username"
' when identifying a text box using AI. Then it instructs UFT to go back to AI text recognition
AIUtil.RunSettings.TextMatch = micExactMatch
AIUtil("text_box", "username").Type "test"
AIUtil.RunSettings.TextMatch = micAIMatch