Highlighted
Absent Member.
Absent Member.
278 views

UFT 12.51- Unable to drag and drop wpf(stand alone app) objects

UFT 12.51- Unable to drag and drop wpf(stand alone app) objects

I have a .net stand alone application which uses the Wpf controls all over.
I'm using: UFT 12.51, .net framework 4.5
I want to achieve a drag of an object located on one tab and drop it on another object which is present on another tab.
See the visuals to understand my app:

 

I tried the following methods but nothing worked out.
1st method:
WpfWindow("MediaPackage").WpfObject("dropItemsHere").Click
x = WpfWindow("MediaPackage").WpfObject("dropItemsHere").GetROProperty("abs_x")
y = WpfWindow("MediaPackage").WpfObject("dropItemsHere").GetROProperty("abs_y")
a = WpfWindow("MediaPackageSearch").WpfImage("wpftypename:=image","devname:=PART_Image","index:=0").GetROProperty("abs_x")
b = WpfWindow("MediaPackageSearch").WpfImage("wpftypename:=image","devname:=PART_Image","index:=0").GetROProperty("abs_y")
Set device = CreateObject("Mercury.DeviceReplay")
device.DragAndDrop a+5, b+5, x+5, y+5, 0
Set device = Nothing

2nd method:
WpfWindow("MediaPackage").WpfObject("dropItemsHere").Click
x = WpfWindow("MediaPackage").WpfObject("dropItemsHere").GetROProperty("abs_x")
y = WpfWindow("MediaPackage").WpfObject("dropItemsHere").GetROProperty("abs_y")
a = WpfWindow("MediaPackageSearch").WpfImage("wpftypename:=image","devname:=PART_Image","index:=0").GetROProperty("abs_x")
b = WpfWindow("MediaPackageSearch").WpfImage("wpftypename:=image","devname:=PART_Image","index:=0").GetROProperty("abs_y")
j = WpfWindow("MediaPackage").Wpfobject("name:=Border","devname:=PART_TabBorder","index:=1").GetROProperty("abs_x")
k = WpfWindow("MediaPackage").Wpfobject("name:=Border","devname:=PART_TabBorder","index:=1").GetROProperty("abs_y")
Set device = CreateObject("Mercury.DeviceReplay")
device.MouseDown a+5, b+5, 0
device.MouseMove j+5, k+5
Wait 1
device.MouseUp x+3, y+3, 0
Set device = Nothing

3rd method:
WpfWindow("MediaPackageSearch").WpfImage("wpftypename:=image","devname:=PART_Image","index:=0”).Drag 5, 5
WpfWindow("MediaPackage").WpfObject("dropItemsHere").Drop 5, 5

0 Likes
1 Reply
Highlighted
Absent Member.
Absent Member.

Re: UFT 12.51- Unable to drag and drop wpf(stand alone app) objects

Any suggestion for the above query

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.