Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..
1032 views

Getting a double click? in UFT 12.5

Jump to solution

Hello, I am trying to get a double click to work after a given line is selected.  Here is what I am using.  What am I doing wrg?  Please advise and thanks.

Browser("Haworth Lynx Home").Page("Haworth Lynx Quote").Frame("StandardWindow").WebElement("View Report For Selected").Click

Dim DeviceReplay, target, abs_x, abs_y

Set DeviceReplay = CreateObject ("Mercury.DeviceReplay")
Set target = Browser("Haworth Lynx Home").Page("Haworth Lynx Quote").Frame("StandardWindow").WebElement("View Report For Selected")

abs_x = target.GetROProperty("abs_x")
abs_y = target.GetROProperty("abs_y")

DeviceReplay.MouseMove abs_x, abs_y
DeviceReplay.MouseDblClick abs_x, abs_y, 0

Set DeviceReplay = Nothing
0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Re: Getting a double click? in UFT 12.5

Jump to solution

Hi

You should add Height/2 and width/2 to click at centre exactly.

Try below code

abs_x = target.GetROProperty("abs_x")
abs_y = target.GetROProperty("abs_y")
height = target.GetROProperty("height")
width = target.GetROProperty("width")
target.highlight
DeviceReplay.MouseMove abs_x, abs_y
DeviceReplay.MouseDblClick abs_x+width/2, abs_y+height/2, 0

Set DeviceReplay = Nothing

 

View solution in original post

0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

Re: Getting a double click? in UFT 12.5

Jump to solution

Hi

You should add Height/2 and width/2 to click at centre exactly.

Try below code

abs_x = target.GetROProperty("abs_x")
abs_y = target.GetROProperty("abs_y")
height = target.GetROProperty("height")
width = target.GetROProperty("width")
target.highlight
DeviceReplay.MouseMove abs_x, abs_y
DeviceReplay.MouseDblClick abs_x+width/2, abs_y+height/2, 0

Set DeviceReplay = Nothing

 

View solution in original post

0 Likes
Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..

Re: Getting a double click? in UFT 12.5

Jump to solution

For some reason this did not work...  even though it appears to have...  It highlighted an object in the row that was selected by the .Click  It does not execute by pressing the Enter key.  Any ideas?

0 Likes
Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..

Re: Getting a double click? in UFT 12.5

Jump to solution

Disregard my last post, it now appears to be working fine.  Thanks for the help. 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.