Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FireEvent "onmouseover" doesn't work
#1
Hi,

I wanted to capture tool tip. for that I used following code.
But the problem is QTP executes it, also shows the result as "done" for that step. It actually (practically) doesn't hover the pointer at the link. Due to this, it does not capture the tool tip because tool tip does not appear only.

During execution, I manually hover the pointer at the link or anywhere, whatever tool tip appeared, it captured and it worked. Only the problem is, even after executing the "FireEvent" method successfully, it does not perform the action.
Please tell me what is the solution.

Code:-

Code:
' Place mouse cursor over the link 'Browser("abc").Page("abc").Frame("xyz").Link("opq").FireEvent "onmouseover" 'wait 1 ' Grab tooltip 'ToolTip = Window("nativeclass:=tooltips_class32").GetROProperty("text") 'msgbox (ToolTip)
Reply
#2
Below 2 possible solutions for the webobject s

Usually all the web Object which have tool tip value you can get using
Code:
Browser("abc").Page("abc").Frame("xyz").Link("opq").GetROProperty("alt")

In some other cases you will title in outerhtml
Code:
sOuterHtml = wImageObject.GetROPRoperty("outerhtml") sHelptext = Trim(Mid (sOuterHtml, InStr(1, sOuterHtml, "title="), InStr(1, sOuterHtml, "src=") - InStr(1, sOuterHtml, "title="))) sHelptext = Mid (sHelptext, InStr(1, sHelptext, """")) sHelptext = Mid (sHelptext, 2, Len(sHelptext)-2)
Reply
#3
Code:
Dim mm mm=browser("Google").Page("Google").image("Google").GetROProperty("alt") msgbox mm,0
Reply
#4
But for me, problem is....Tool tip does not display the text of that link.

It gives some other message....
e.g. If text of the link is "abc"...but tool tip will display "click to ..."
Reply
#5
Hi,

The above code works when you set the replay type as 'Mouse'.

To do this, visit the 'Tools -> Option' menu in QTP. Click the Advanced Option in the Web menu. By Default Run Settings -> 'Event' option will be selected. Change it to 'Mouse' and apply the settings.

Run the code
Code:
'Browser("abc").Page("abc").Frame("xyz").Link("opq").FireEvent "onmouseover" 'wait 1 ' Grab tooltip 'ToolTip = Window("nativeclass:=tooltips_class32").GetROProperty("text") 'msgbox (ToolTip)

Will work fine.

The replay type can also be set using:
Code:
Setting.Webpackage("ReplayType") = 1 Setting.Webpackage("ReplayType") = 2

where, 1 is for Event Replay type and 2 is for Mouse Replay type.
Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Object doesn't support this property or method takecharge 1 2,186 11-13-2019, 10:05 PM
Last Post: stormbringer
  QTP 11.5 doesn't identify swf objects arpan 2 3,429 01-07-2014, 12:44 AM
Last Post: arpan
  SQL on oracle database doesn't return a value Bluefields 2 3,845 07-09-2012, 01:23 PM
Last Post: Bluefields
  How to fireevent on mouse over for Web Element vnsk 3 40,568 10-13-2011, 11:51 AM
Last Post: vnsk
Question QTP doesn't run what was recorded sdcaldwell 0 3,650 02-03-2011, 01:43 AM
Last Post: sdcaldwell

Forum Jump:


Users browsing this thread: 1 Guest(s)