Micro Focus QTP (UFT) Forums

Full Version: Problem while extracting tooltip!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All...

I need to take the tooltips from a webpage...
I tried the below script from some previos post...

Code:
Browser("Yahoo!").Page("Yahoo!").WebElement("text:=My Yahoo!").FireEvent "onmouseover"
wait 1
' Grab tooltip
ToolTip = Window("nativeclass:=tooltips_class32").GetROProperty("text")
msgbox ToolTip

I am getting the following error...
Cannot identify the object "[ Window ]" (of class Window). Verify that this object's properties match an object currently displayed in your application.
Line (4):
Code:
"ToolTip = Window("nativeclass:=tooltips_class32").GetROProperty("text")".

I tried using Object spy...but when I am holding the control key , the tooltip was not displaying..

Please suggest what can I do....

Thanks in advance.

Ramya
You can get the tool tip by getting title property of the Object.

As you said if you want to Get tht Tool Tip of Browser("Yahoo!").Page("Yahoo!").WebElement("text:=My Yahoo!")

You can directly get it using the the stmt Browser("Yahoo!").Page("Yahoo!").WebElement("text:=My Yahoo!").GetROProperty("title")
Let me know if it does not work
Hi try this
Code:
Browser("Yahoo!").Page("Yahoo!").Link("My Yahoo").getroproperty("outerhtml")
we will get the outer html tag like <A Title="Go to My Yahoo!,href=........</A>.from this html tag we have to segregare the Output by simple programming...try this let me know if it doenst work.
Hi,

Use the "alt" property to know the tooltip.

Here is the sample script:
Code:
str=browser("MSN.com").Page("MSN.com").Image("Deadliest Cars // Crash").GetROProperty("alt")
msgbox(str)
Thanks & Regards,
Uday.