Skip to main content

SeeTestAutomation- Drag Coordinates

info

Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .

void DragCoordinates(X1, Y1, X2, Y2, Time)

Description

Command to perform drag action based on start coordinates (X,Y) and end coordinates (X,Y) on the device reflection.

Parameters

Drag base on coordinates

  • int X1: X coordinate starting point of where you want to start the drag
  • int  Y1: Y coordinate starting point of where you want to start the drag
  • int  X2: X coordinate starting point of where you want to end the drag
  • int Y2: Y coordinate starting point of where you want to end the drag
  • int Time: Time for the command to be executed (in milliseconds)
info

Note: You can use the p2cx p2cy commands [links] for absolute values not depend on a specific device.

Usage

Scenario: In the following example, we will use the dragCoordinates to drag the safari icon to the dock of the screen.

  1. Before Dragging the application, screen will look like this:

  2. Perform a continuous click on the Safari icon to make it draggable.

  3. Run the command with the following values:

    Parameters set to:

    • x1 - 636

    • y1 - 826

    • x2 - 572

    • y2 - 1166

    • time - 2000

    These values were pull from the debug tab. For more information, see Width/Height. 

    Result after command ends:

Code Examples

Java Example

client.dragCoordinates(636, 826, 572, 1166, 2000);

C# Example Expand source

client.DragCoordinates(636, 826, 572, 1166, 2000);

VBScript Example Expand source

client.DragCoordinates 636, 826, 572, 1166, 2000

Python Example Expand source

self.client.dragCoordinates2(636, 826, 572, 1166, 2000)

Perl Example Expand source

$client->dragCoordinates2(636, 826, 572, 1166, 2000);