Wednesday, July 20, 2011

How to execute double click operation in Firefox using QTP?

To make my question even more clear, consider the following scenario:

Login into Yahoo mail and click on Inbox. Mail list gets opened in the right side. Now when a single click is performed on any mail list item, Mail gets opened under the Mail list in the same tab. Please see following attachment.



When double clicked on the same mail item, mail gets opened completely in a new tab.



In the example shown above, how can double click operation be performed in Firefox using QTP?

Please make a note that using firevent "ondbclick" method will solve the problem only in IE but not in Firefox. So how can this be achieved in Firefox?

Here is the answer for this.....
.
.
.
.
.
You will see an Unspecified error when you use ondblclick directly. This happens because QTP is set to be in Event Replay mode by default.

To make this work, we need switch QTP into Mouse replay Mode before the ondblclick operation and then switch it back to Event mode after it. Here is how you can do that Programatically:

Setting.Webpackage("ReplayType")=2
Browser("Yahoo").Page("Yahoo").WebElement("Element1").FireEvent "ondblclick",40,10
Setting.WebPackage("ReplayType")=1



No comments:

Post a Comment