In UFT 15.0.2 : How to write or passing partials value in AI script.
Question ID: 110079

For Example :

IntPrice = AIUtil.FindTextBlock(“Your Price: $1,533.00”).GetText.

‘Your Price ‘ is static but amount value is changed. so here how to write dynamic script by using static value ( Your Price).


Marked as spam
Posted by (Questions: 4, Answers: 0)
Asked on April 13, 2021 10:30 am
Answers (1)
Private answer

You should be able to remove the number, and UFT's AI will recognize the object anyway. Try:

IntPrice = AIUtil.FindTextBlock(“Your Price: $”).GetText

and see if it works. If there is more than one object on the screen with the same text, it may be more difficult to isolate the one you want. You may need to use some of the tips and tricks listed here: Improve AI-based test object identification (, most notably the "Identifying objects by relative location" section my be particularly helpful.

There are some instances where you need to mix traditional objects with AI objects in your test. In this case, you can simply go into the object properties and make the appropriate property a regular expression. Here's some information on doing that:

Marked as spam
Posted by (Questions: 16, Answers: 807)
Answered on April 15, 2021 12:31 pm

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

Scroll to Top