Drag and drop

Element to drag n drop control. There can be drag and drop by the search templates, and in this case Search pattern (source and destination) must be specified, or drag and drop by coordinates, in this case Coordinates (source and destination) must be specified.

Properties

- Search pattern (source): [String] Source search pattern

- Control (source): [LTools.Desktop.Model.DUIControl] Source element reference

- Coordinates (source): [System.Drawing.Rectangle] Source component coordinates

- Search pattern (destination): [String] Destination search pattern

- Control (destination): [LTools.Desktop.Model.DUIControl] Destination element reference

- Coordinates (destination): [System.Drawing.Rectangle] Destination component coordinates

- Time-out*: [Int32] Element finish max time (ms)

C#
LTools.Desktop.DesktopApp app = LTools.Desktop.DesktopApp.Init(wf, null, "Test_*", 20000, true, LTools.Desktop.Model.DesktopTypes.UIAUTOMATION);
//Search template
app.DragNDrop("{\"Name\":\"Всем привет!\",\"AutomationID\":\"lbl1\",\"ClassName\":\"Text\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}",
		"{\"Name\":\"\",\"AutomationID\":\"txtTarget\",\"ClassName\":\"TextBlock\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}",
		null, null, System.Drawing.Rectangle.Empty, System.Drawing.Rectangle.Empty, 10000);
//Component link
LTools.Desktop.Model.DUIControl el_from = app.FindElement("{\"Name\":\"Всем привет!\",\"AutomationID\":\"lbl1\",\"ClassName\":\"Text\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}");
LTools.Desktop.Model.DUIControl el_to = app.FindElement("{\"Name\":\"\",\"AutomationID\":\"txtTarget\",\"ClassName\":\"TextBlock\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}");
app.DragNDrop(null, null, el_from, el_to, System.Drawing.Rectangle.Empty, System.Drawing.Rectangle.Empty, 10000);
//Coordinates
app.DragNDrop(null, null, null, null, new System.Drawing.Rectangle(100, 150, 0, 0), new System.Drawing.Rectangle(200, 250, 0, 0));

Python
app = LTools.Desktop.DesktopApp.Init(wf, None, "Test_*", 20000, True, LTools.Desktop.Model.DesktopTypes.UIAUTOMATION)
#Search template
app.DragNDrop("{\"Name\":\"Всем привет!\",\"AutomationID\":\"lbl1\",\"ClassName\":\"Text\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}",
	"{\"Name\":\"\",\"AutomationID\":\"txtTarget\",\"ClassName\":\"TextBlock\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}",
	None, None, System.Drawing.Rectangle.Empty, System.Drawing.Rectangle.Empty, 10000)
#Component link
el_from = app.FindElement("{\"Name\":\"Всем привет!\",\"AutomationID\":\"lbl1\",\"ClassName\":\"Text\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}")
el_to = app.FindElement("{\"Name\":\"\",\"AutomationID\":\"txtTarget\",\"ClassName\":\"TextBlock\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}")
app.DragNDrop(None, None, el_from, el_to, System.Drawing.Rectangle.Empty, System.Drawing.Rectangle.Empty, 10000)
#Coordinates
app.DragNDrop(None, None, None, None, System.Drawing.Rectangle(100, 150, 0, 0), System.Drawing.Rectangle(200, 250, 0, 0))
		
JavaScript
var app = _lib.LTools.Desktop.DesktopApp.Init(wf, null, "Test_*", 20000, true, _lib.LTools.Desktop.Model.DesktopTypes.UIAUTOMATION);
//Search template
app.DragNDrop("{\"Name\":\"Всем привет!\",\"AutomationID\":\"lbl1\",\"ClassName\":\"Text\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}",
		"{\"Name\":\"\",\"AutomationID\":\"txtTarget\",\"ClassName\":\"TextBlock\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}",
		null, null, _lib.System.Drawing.Rectangle.Empty, _lib.System.Drawing.Rectangle.Empty, 10000);
//Component link
var el_from = app.FindElement("{\"Name\":\"Всем привет!\",\"AutomationID\":\"lbl1\",\"ClassName\":\"Text\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}");
var el_to = app.FindElement("{\"Name\":\"\",\"AutomationID\":\"txtTarget\",\"ClassName\":\"TextBlock\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}");
app.DragNDrop(null, null, el_from, el_to, _lib.System.Drawing.Rectangle.Empty, _lib.System.Drawing.Rectangle.Empty, 10000);
//Coordinates
app.DragNDrop(null, null, null, null, new _lib.System.Drawing.Rectangle(100, 150, 0, 0), new _lib.System.Drawing.Rectangle(200, 250, 0, 0));		

Last updated