How To Get Tooltip Text In UFT

We usually use object spy in UFT to see the properties of an object be it a web application or windows application. While doing automation testing you may run over a circumstance wherein you need to validate the tooltip of an object in the application under test. On the off chance that you will attempt to catch the property of the tooltip using object spy, you would not have the capacity to succeed and it would be a very frustrating experience and you might be wondering how to figure it out. This article will help you out with how to get tooltip text in UFT.

Get Tooltip Text In UFT

Well, the answer is quite simple. The text that shows up in the tooltip is nothing but one of the properties of the object on which hovering the mouse displays the tooltip. For example, if you hover the mouse over the question mark object of the HPE Sample MyFlight application it shows up a tooltip having the text “UFT Tutorial”.

UFT-ToolTip-Text

If you use Object Spy to view the properties of the question mark object, you will see that it is helptext property of the question mark object. 
HelpText
 

Example – Get Tooltip Text In UFT

You can retrieve this property at runtime using the GetRoProperty method.

In other applications, the property of the tooltip text could be different. In most web applications, the property name of the tooltip is “title”. On the google search page, the tooltip property of the search text box is “title”.

capture tooltip text in uft

You can get the tooltip text value using GetRoProperty.

Conclusion

Tooltip is one of the properties of the object on which hovering the mouse displays the tooltip. So it is concluded that if you have to retrieve the tooltip value of an object, you have to use object spy to find out its property name which shows up in the tooltip text and use GetRoProperty to retrieve its value.

Recommended Posts

Leave a Reply