Drag Method

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

Simulates touching the screen at the specified point for the specified period of time and then moving a fingertip to the specified point. The touch coordinates are relative to the control position.

Declaration

TestObj.Drag(StartX, StartY, DistanceX, DistanceY, FromHoldDuration)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
StartX [in]    Required    Integer    
StartY [in]    Required    Integer    
DistanceX [in]    Required    Integer    
DistanceY [in]    Required    Integer    
FromHoldDuration [in]    Optional    Integer Default value: 0   
Result None

Applies To

The method is applied to the following object:

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:

StartX

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

StartY

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

DistanceX

Specifies the horizontal distance of the drag action.

DistanceY

Specifies the vertical distance of the drag action.

FromHoldDuration

Specifies the touch delay (in milliseconds).

Result Value

None.

Remarks

This method is not supported on iOS devices.

See Also

About Mobile Tests

Highlight search results