Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to retrieve tool tip text of an object
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

I want to check if a tool tip exists for a specific object and retrieve the text of the same. I use VBscripting in Qtp. plz help if anyone knows the answer.. Thanks in advance. ...


Regards,
Sreedevi.
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Sreedevi,

Have you tried searching this forum? there are many threads discussed on the same topic.

try this example which is for a link object
Code:
Browser("").Page("").Frame("").Link("").mouseover
wait 2
tooltip = Window("nativeclass:=tooltips_class32").GetROProperty("text")
msgbox tooltip

or if you can see the tooltiptext in the properties list of object at spy then you can try with this as well
Code:
Browser("").Page("").Frame("").Link("").GetROProperty("TooltipText")

does this help?

Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
HI Saket,

Thanks for ur quick reply..
However, i want to know if we can move the mouse over the specific objects on the screen using VBScript. This is because the code above can be used when the mouse is placed over the object required. Manaul interference is needed for the above code... Plz help in case if have answer..

Regards,
Sreedevi.
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Changing the replay type to mouse should solve the issue
use below code before the statements
Code:
Setting.WebPackage("ReplayType") = 2
again make it back to event setting the type to 1

Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
U could use
Code:
m=Browser("xxxx").page("xxx").frame("xxxx") .Getrowproperty("alt")
if m= "Tool tip" then msgbox "Pass"
else
msgbox"Fail"
It definetly work,,,,
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Saket's suggestion should work if the application you are working is a Web Based. Else it doesnt make a difference.

If you are working on something for which you know the co-ordinates of the object then you can exploit user32.dll to get a method called SetCursorPos to the co-ordinate and then use

Code:
tooltip = Window("nativeclass:=tooltips_class32").GetROProperty("text")
msgbox tooltip

I have posted the solution on this forum several times. Search using SetCursorPos and you will get the solution.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to Verify Static Object Text which is changing Dynamically with Expected Result johnny77 0 3,303 06-25-2015, 11:32 AM
Last Post: johnny77
  QTP Automation: How to retrieve Reporter.Reportevent Message scsenthil 1 5,408 11-14-2013, 07:51 PM
Last Post: spannerj
  How to retrieve ArrayList saved in Environment Variable Gautam26 8 4,755 11-07-2013, 08:26 PM
Last Post: ssvali
  Read text from text file and save it into a variable in qtp arpan 3 12,972 06-19-2013, 08:34 PM
Last Post: arpan
Exclamation Retrieve the complete height and width of a browser beyond the visible part as wel learnQtptips 0 2,114 05-22-2013, 09:36 AM
Last Post: learnQtptips

Forum Jump:


Users browsing this thread: 1 Guest(s)