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:
UFT One versions 2022 and later: Web, mobile, and SAP GUI for Windows.
UFT One versions 2021 R1 and earlier: Web and mobile.
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.
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.
'The following example checks whether we are using the local or remote AI service 'If local, instruct UFT One to use the UFT OCR settings for AI indentification If AIUtil.RunSettings.AIServiceMode = Local_AI Then AIUtil.RunSettings.Ocr.UseConfigSet = UFT_OCR EndIf
Note: This statement is meant only to demonstrate code syntax. You can also use UFT_OCR if you are using the remote AI service.
'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 EndIf
'Select an item far down the list, then change the next Select 'to scroll up for an item at the top, scrolling up to 5 times, 'each scroll spanning 2 mouse-wheel ticks AIUtil.SetContext Browser("creationtime:=0") AIUtil("combo_box", "books").Select"Zenith" AIUtil.RunSettings.ComboBoxSelect.ScrollingDirection = "up" AIUtil.RunSettings.ComboBoxSelect.TicksPerScroll = 2 AIUtil.RunSettings.ComboBoxSelect.MaxScrollNum = 5 AIUtil("combo_box", "books").Select"ABC"
'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" EndIf AIUtil.FindTextBlock("Se connecter en toute sécurité").Click
'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 IfNot WasEnabled Then AIUtil.RunSettings.VerifyIdentification.Disable EndIf
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'.
'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
Tips to improve your search results...UFT One Object Model ReferenceVersion: 2021-2023UFT One OMR2021-2023AllView Local Help CenterView Online Help CenterbackGo back in browser historyforwardGo forward in browser historyRemove search highlightsnext topicGo to next topicprevious topicGo to previous topicPrint the current topicVersion: