Micro Focus QTP (UFT) Forums

Full Version: How to capture Tool tip
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was facing difficulty in capturing tooltip of the webelement that comes in the webapplication.

I tried up with mousemove but even that is not working.
Kindly suggets some method
Check this article 4 Ways to capture Tool tips in UFT

You can also capture the text property from the tooltips_class32 control using using MouseOver method ( for web objects) otherwise MouseMove method.

Code:
' Mouseover
Browser("XXXX").Page("YYYY").Link("Link A").MouseOver
' Wait 1 second to get the tool tip displayed.
wait 1
' Capture the text of the tooltip object
txt= Window("nativeclass:=tooltips_class32").GetROProperty("text")
msgbox txt

[Check the class type if your application use different class for tooltip object, using object spy)
Hi Ankur

But your code works when i am placing my mouse over the object.Can't we do it dynamically.
Hi Ankur

Your code works when ever i am placing my mouse over the object.Is there any dynamic way to handle this.
what do you mean by "dynamically"?
Have you found a solution yet?
Even you can use the below code:
Code:
ttext=Browser("XXXX").Page("YYYY").Link("Link A").GetROProperty("TooltipText")
msgbox ttext
wt abt this: GetROProperty("alt") ?
Hi Ankur,
I need to place my mouse pointer over the link manually to pass the test script, otherwise it doesn't move the mouse pointer automatically to the link. and test fails(gives error)

"Cannot identify the object "[ Window ]" (of class Window). Verify that this object's properties match an object currently displayed in your application."

I am using QTP 9.0 version.

regards,
Yugal