Tooltip can’t be read by Quick Test Pro
Question ID: 104987
0
0

I cannot get a tooltip text from Quick test since it pops up and can’t spy on object.

Marked as spam
Posted by (Questions: 4, Answers: 0)
Asked on April 30, 2013 4:09 pm
163 views
Answers (1)
2
Private answer

Tooltips are tricky with QTP. I have found that you can use mouse overs in conjunction with a property grab via descriptive programming. Please see my overview below which will give you an idea of how to approach this:

'There are a couple of ways to move the mouse to an object. One is with the DeviceReplay, and the other is with a direct mouse move.

'Example 1
Set obj = CreateObject(''Mercury.DeviceReplay'')
obj.MouseMove x, y

'Example 2
Window(''TestApp'').WinObject(''icon1'').MouseMove 22,15

'Next, follow the mouse movement with a delay and then a text capture using descriptive programming

Wait 2 '(delay to allow tooltip to appear)

' Capture the text of the tooltip object
txt= Window(''nativeclass:=.*tooltips_class32.*'',''index:=0'').GetROProperty(''regexpwndtitle'')
msgbox txt

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'If the object is web-based, then you can use something like the following:

Browser(''Browser'').Page(''Page'').Link(''Link X'').MouseOver
' Wait a second to allow the tooltip to be displayed.
wait 1
' Capture the text of the tooltip object

txt= Window(''nativeclass:=.*tooltips_class32.*'',''index:=0'')
MsgBox txt

Marked as spam
Posted by (Questions: 2, Answers: 477)
Answered on April 30, 2013 4:11 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top