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.
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”.
Example – Get Tooltip Text In UFT
1 |
Msgbox WpfWindow("HPE MyFlight Sample Applicatio").WpfButton("WpfButton").GetROProperty("helptext") |
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”.
You can get the tooltip text value using GetRoProperty.
1 |
Msgbox Browser("Google").Page("Google").WebEdit("q").GetROProperty("title") |
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
- How to Use Call Stack in UFT to Trace Function Calls with Example
- How to Debug a Test in UFT
- How to Use XPath in UFT One To Identify Web-Based Objects
- GetRoProperty , SetToProperty & GetToProperty in UFT With Example
- Terminal Emulator Configuration in UFT
- How To Use Dictionary Object in UFT With Examples
- Action Input And Output Parameters In UFT
- Difference between ChildObjects and ChildItem in UFT
- How to Use Shell Scripting in UFT to SendKeys