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

Category:
Question ID: 110079
0
0

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: 3, Answers: 0)
Asked on April 13, 2021 10:30 am
9 views
Answers (1)
0
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 (microfocus.com), 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:

https://admhelp.microfocus.com/uft/en/15.0-15.0.2/UFT_Help/Content/User_Guide/Constant_Value_Options.htm

https://admhelp.microfocus.com/uft/en/15.0-15.0.2/UFT_Help/Content/User_Guide/maintain_IDProps_in_ORs_TEST.htm#mt-item-0

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