Automation QTP tutorial-double clicking on any object

Hey guys. Todays tutorial is quick. If you want to double click on any object, just identify your current browser, page, and object you want to click on. But instead of the regular click method to click on it, we will user FireEvent("ondblclick").

Browser("Index:=0").Page("title:=.*").WebElement("innertext:=unique property name").FireEventĀ "ondblclick"

The Index of the Browser is dependent on how many browser windows you have open, and in which order the windows were opened. So if you have 2 browser windows open and you want to click on the first window, set the browser index=0. If you want to click on the second window, set the index=1. Easy right?

The page title is using the .* regular expression which just means that the a specific page title is not needed. Find the generic page that is associate with the browser window.

the "unique property name" for the web element can be anything. So if you have a web element with a unique property such as "WebElement1" then the code above would look like WebElement("innertext:=WebElement1")

Lastly, as explained above, just use the FireEventĀ "ondblclick" to double click on this object. You can replicate this code for any object that you would like to click on. Post your comments and questions below! We love your feedback!!

Pin It on Pinterest

Clef two-factor authentication