TouchRelease Method

Applies to TestComplete 14.10, last modified on June 5, 2019

Description

Simulates releasing the screen at the specified point.

Declaration

ProgObj.TouchRelease(XY)

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 of the point where releasing will be simulated.

Y

Specifies the vertical coordinate of the point where releasing will be simulated.

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 example below demonstrates how to use the TouchRelease method:

JavaScript, JScript

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

  // Launch the tested application
  …

  // Simulate user actions
  …
  Mobile.Device().TouchRelease(100, 100);
  …

}

Python

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

  # Launch the tested application
  # ...

  # Simulate user actions
  # ...
  Mobile.Device().TouchRelease(100, 100)
  # ...

VBScript

Sub Test

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

  ' Launch the tested application
  …

  ' Simulate user actions
  …
  Call Mobile.Device.TouchRelease(100, 100)
  …

End Sub

DelphiScript

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

  // Launch the tested application
  …

  // Simulate user actions
  …
  Mobile.Device.TouchRelease(100, 100);
  …

end;

C++Script, C#Script

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

  // Launch the tested application
  …

  // Simulate user actions
  …
  Mobile["Device"]["TouchRelease"](100, 100);
  …

}

See Also

Testing Mobile Applications
TouchPress Method
AndroidDevice Object
iOSDevice Object

Highlight search results