TouchAction¶
This is a JavaScript wrapper for TouchAction of Appium .NET library. Requires Rapise 8.0+.
Action Summary¶
Action | Description |
---|---|
Cancel | Cancels the touch action. |
LongPress | Presses at the specified location in the element until the context menu appears. |
MoveTo | Moves to the specified location in the element. |
Perform | Executes the touch action. |
Press | Presses at the specified location in the element. |
Release | Releases the pressure. |
Tap | Taps at the specified location in the element. |
Wait | Waits for the given duration. |
Action Detail¶
Cancel¶
Cancels the touch action.
TouchAction.Cancel()
LongPress¶
Presses at the specified location in the element until the context menu appears. If no element is specified presses at the specified location on the screen.
TouchAction.LongPress(x, y, element)
Parameters:
Name | Type | Description |
---|---|---|
x | number | The x coordinate relative to the element or the screen top-left corner. |
y | number | The y coordinate relative to the element or the screen top-left corner. |
element | AppiumElementWrapper | The target element. Optional. |
Returns:
Self-reference for chaining additional actions.
MoveTo¶
Moves to the specified location in the element. If no element is specified moves to the specified location on screen.
TouchAction.MoveTo(x, y, element)
Parameters:
Name | Type | Description |
---|---|---|
x | number | The x coordinate relative to the element or the screen top-left corner. |
y | number | The y coordinate relative to the element or the screen top-left corner. |
element | AppiumElementWrapper | The target element. Optional. |
Returns:
Self-reference for chaining additional actions.
Perform¶
Executes the touch action.
TouchAction.Perform()
Press¶
Presses at the specified location in the element. If no element is specified presses at the specified location on screen.
TouchAction.Press(x, y, element)
Parameters:
Name | Type | Description |
---|---|---|
x | number | The x coordinate relative to the element or the screen top-left corner. |
y | number | The y coordinate relative to the element or the screen top-left corner. |
element | AppiumElementWrapper | The target element. Optional. |
Returns:
Self-reference for chaining additional actions.
Release¶
Releases the pressure.
TouchAction.Release()
Returns:
Self-reference for chaining additional actions.
Tap¶
Taps at the specified location in the element. If no element is specified taps at the specified location on screen.
TouchAction.Tap(x, y, count, element)
Parameters:
Name | Type | Description |
---|---|---|
x | number | The x coordinate relative to the element. |
y | number | The y coordinate relative to the element. |
count | number | The number of times to tap. |
element | AppiumElementWrapper | The target element. Optional. |
Returns:
Self-reference for chaining additional actions.
Wait¶
Waits for the given duration.
TouchAction.Wait(ms)
Parameters:
Name | Type | Description |
---|---|---|
ms | number | The amount of time to wait in milliseconds. |
Returns:
Self-reference for chaining additional actions.