Simulate mouse drag using the left button
Namespace:
QAliber.Engine.ControlsAssembly: QAliber.Engine (in QAliber.Engine.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
public virtual void Drag( Point rel1, Point rel2 ) |
| Visual Basic (Declaration) |
|---|
Public Overridable Sub Drag ( _ rel1 As Point, _ rel2 As Point _ ) |
| Visual C++ |
|---|
public: virtual void Drag( Point rel1, Point rel2 ) |
Parameters
- rel1
- Type: System.Windows..::.Point
The point in pixels relative to the top left corner of the control, from which to start the drag
- rel2
- Type: System.Windows..::.Point
The point in pixels relative to the top left corner of the control, to end the drag
Examples
Following example will locate calc and will drag it from titlebar (point (150,15)) to the middle of screen.
CopyC#
System.Diagnostics.Process.Start("calc"); //Wait for calc app to appear UIAWindow calcMainWin = Desktop.UIA.WaitForControl(@"Calculator",2000) as UIAWindow; if (calcMainWin != null)//not found above calcMainWin.Drag(new Point(150, 15), new Point(300, 300));