QTP – Fix for FireEvent Issue in Google Chrome and FireFox Browsers

by Joe Colantonio on January 12, 2012

Post image for QTP – Fix for FireEvent Issue in Google Chrome and FireFox Browsers

FireEvent Issue

The other day I received an email from a blog friend who was having issues with QTP's FireEvent in Google Chrome. The FireEvent's dblclick option was not working on a WebElement. The same exact script, however, was working fine against IE. Since I didn't have access to the application, I wasn't really sure what to suggest. Happily, as it turned out, I was able reproduce the same behavior against an application that I did have access to. This is what I found:

Solution

After trying a few things, on a whim I changed QTP's Replay type from Event to Mouse and reran the script. To my amazement, it worked! To change the event type:

  • In QTP navigate to Tools>Options
  • Select Web from the left navigation
  • Click Advanced
  • Find the Replay Type under the Run settings and select the Mouse Replay type.

 

 

(Not everyone will want to do this since it affects the whole script.)

Programmatically write code to change the Replay type:

Another option would be to set the replay mode within the script using code. This will enable you to write code that first checks the browser type before changing the Replay type. All this can be done with one line of code:

Setting.webpackage("ReplayType") = 2 ' 2 = Mouse 1 = Event

It works on my machine!

The above solution resolved my issue -- I'm hoping it also works for you! Cheers~Joe

{ 5 comments… read them below or add one }

christian tan March 2, 2012 at 10:09 am

Hi! I wonder if you guys encountered a problem for google chrome. when QTP11 spy an object it will retunr in the object hierarchy as: Window ->WinObject or Browser -> WinObject.

Thanks!

Reply

Joe Colantonio March 2, 2012 at 7:01 pm

christian tan » Hi – does this happen on all machines or just one? What OS? Is it a VM machine?

Reply

Vanesa November 7, 2012 at 3:14 pm

We have this problem with chrome, we write layer on the input and we need expect the suggestions and select one of them, and then i use fireevent “onkeyup” but in chrome is not working.
You know about this?
Browser(“…”).Page(“…”).WebEdit(“tema1″).Set “layer”
Browser(“…”).Page(“…”).WebEdit(“tema1″).FireEvent “onkeyup”

Thank you!!

Reply

Joe Colantonio November 14, 2012 at 3:46 pm

Vanesa » Sorry – I have not seen this behavior. Anyone else know how to resolve?

Reply

cetejas March 21, 2013 at 4:14 am

Hi Joe,

we have webelement in page, of windows applicaton, but QTP 11.0 recognised it as winobject. Is any solution for it?

Reply

Leave a Comment

Previous post:

Next post: