Get Text From Insight Object in UFT

Question ID: 105644

Is there a way to get the text off an Insight object in UFT??

Marked as spam
Posted by (Questions: 341, Answers: 22)
Asked on October 24, 2014 6:41 pm
Answers (1)
Private answer

I found the following work-around in an HP KM article, KM00484151. It's not super elegant but at least it works.

To workaround this limitation using other UFT features, the following option can be used:

1. While in record mode, add a ''Text Output Value'' (Design > Output Value > Text Output
2. Click the text in your application.
3. In the Text Output Value Properties dialog, make sure that the operation is Output Text and
that the summery test says ''Output the whole text into <....>''
Notes: you can modify the output name and the target DataTable sheet. You can also modify
the name of the output value itself to a more meaningful name in the Object Repository Editor.
4. Create an Insight test object that represents your object (showing the desired text on it).
5. Add an Output step on the insight object, using the output value object recorded in step #1.
For example, test code will look like this:
.InsightObject().Output Checkpoint(''MyOutputTextName'')
6. Comment or remove the initial text output step (recording in step #1).
7. The output value is expected to fetch the text in the Insight test object and save it to the
DataTable as output value. It can be used from the DataTable or set to a variable.

Marked as spam
Posted by (Questions: 16, Answers: 751)
Answered on October 24, 2014 6:42 pm
Yeah, that's not really elegant at all, but it did work. I wish there was an insight property that we could just use GetROProperty on to find it!
( at October 24, 2014 6:43 pm)