Mouse Click from QTP using DeviceReplay

Sometimes, we often come across a situation where we want QTP to send actual mouse click to some x & y coordinates of screen. QTP in-built “.click” method won’t help you in these situations. So, here is code to perform this action:

Set objDeviceReplaytest = CreateObject("mercury.devicereplay")
 x = objElement.GetROProperty("abs_x")
 y = objElement.GetROProperty("abs_y")
 objDeviceReplaytest.MouseClick x + 5 , y + 5,0
 Set objDeviceReplaytest = Nothing

Comments

Popular posts from this blog

How to maximize FireFox browser from QTP

How to search and click a link in a WebTable?

How to take screenshot of failed QTP step?