LongTouch Action (Mobile Objects)

Applies to TestComplete 15.47, last modified on January 20, 2023
This method is available in legacy mobile tests that work with devices connected to the local computer. To learn how to simulate user actions in newer cloud-compatible mobile tests, see the Simulating user actions in tests section.

Description

Simulates a long touch at the specified point of an object in an iOS and Xamarin.Forms applications (by default, in the object’s center).

Declaration

TestObj.LongTouch(X, Y, HoldDuration)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
X [in]    Optional    Integer Default value: -1   
Y [in]    Optional    Integer Default value: -1   
HoldDuration [in]    Optional    Integer Default value: 1000   
Result None

Applies To

All iOS and Xamarin.Forms objects

View Mode

This method is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Parameters

The method has the following parameters:

X

Specifies the horizontal coordinate (in pixels) of the long touch action. This coordinate is specified relative to the top-left corner of the underlying control. If the coordinate is omitted, the long touch is simulated in the center of the control.

Y

Specifies the vertical coordinate (in pixels) of the long touch action. This coordinate is specified relative to the top-left corner of the underlying control. If the coordinate is omitted, the long touch is simulated in the center of the control.

HoldDuration

Specifies the touch duration (in milliseconds).

Result Value

None.

Remarks

If this method is called for an object obtained by using optical character recognition on an Android device, the method’s HoldDuration parameter will be ignored.

See Also

Testing iOS Applications (Legacy)
Testing Xamarin.Forms Applications (Legacy)
LongTouch Action (Android Objects)
Simulating Basic Touch Actions Over Android Devices (Legacy)
Touch Action (Mobile Objects)

Highlight search results