Move Method (Device object)

Applies to TestComplete 15.70, last modified on December 17, 2024
The information below concerns legacy mobile tests that work with mobile devices connected to the local computer. For new mobile tests, we recommend using the newer cloud-compatible approach.

Description

Simulates moving a fingertip to the specified point.

Declaration

ProgObj.Move(X, Y)

ProgObj An expression, variable or parameter that specifies a reference to one of the objects listed in the Applies To section
X [in]    Required    Integer    
Y [in]    Required    Integer    
Result None

Applies To

The method is applied to the following objects:

Parameters

The method has the following parameters:

X

Specifies the horizontal coordinate (in pixels) of the point to which a finger will be moved.

Y

Specifies the vertical coordinate (in pixels) of the point to which a finger will be moved.

Result Value

None.

Remarks

This method is asynchronous. This means that TestComplete continues running the test, no matter whether it has finished or not. For information on how it may affect testing on Android devices, see Possible Issues.

Example

The following example demonstrates how to use the Move method:

JavaScript, JScript

function Test()
{
  // Specify the current device
  Mobile.SetCurrent("MyDevice");

  // Launch the tested application
  …

  // Simulate user actions
  …
  Mobile.Device().Move(27, 27);
  …

}

Python

def Test():
  # Specify the current device
  Mobile.SetCurrent("MyDevice")

  # Launch the tested application
  # ...

  # Simulate user actions
  # ...
  Mobile.Device().Move(27, 27)
  # ...

VBScript

Sub Test

  ' Specify the current device
  Call Mobile.SetCurrent("MyDevice")

  ' Launch the tested application
  …

  ' Simulate user actions
  …
  Call Mobile.Device.Move(27, 27)
  …

End Sub

DelphiScript

procedure Test;
begin
  // Specify the current device
  Mobile.SetCurrent('MyDevice');

  // Launch the tested application
  …

  // Simulate user actions
  …
  Mobile.Device.Move(27, 27);
  …

end;

C++Script, C#Script

function Test()
{
  // Specify the current device
  Mobile["SetCurrent"]("MyDevice");

  // Launch the tested application
  …

  // Simulate user actions
  …
  Mobile["Device"]["Move"](27, 27);
  …

}

See Also

AndroidDevice Object
iOSDevice Object
TouchPress Method
TouchRelease Method
Drag Method
TouchAndHold Method
Swipe Method
Testing Mobile Applications

Highlight search results