Package io.appium.java_client
Class TouchAction<T extends TouchAction<T>>
java.lang.Object
io.appium.java_client.TouchAction<T>
- All Implemented Interfaces:
PerformsActions<T>
- Direct Known Subclasses:
AndroidTouchAction,IOSTouchAction
@Deprecated
public class TouchAction<T extends TouchAction<T>>
extends Object
implements PerformsActions<T>
Deprecated.
Touch actions are deprecated.
Please use W3C Actions instead or the corresponding
extension methods for the driver (if available).
Check
- https://www.youtube.com/watch?v=oAJ7jwMNFVU
- https://appiumpro.com/editions/30-ios-specific-touch-action-methods
- https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
for more details.
Used for Webdriver 3 touch actions
See the Webriver 3 spec
https://dvcs.w3.org/hg/webdriver/raw-file/default/webdriver-spec.html
The flow is to chain individual touch actions into an entire gesture. e.g.
TouchAction action = new TouchAction(performsTouchActions);
action.press(element).waitAction(300).moveTo(element1).release().perform();
Calling perform() sends the action command to the Mobile Driver. Otherwise,
more and more actions can be chained.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classDeprecated.Just holds values to eventually return the parameters required for the mjsonwp. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Deprecated.Cancel this action, if it was partially completed by the performsTouchActions.protected TDeprecated.Clears all the existing action parameters and resets the instance to the initial state.Deprecated.Get the mjsonwp parameters for this Action.longPress(LongPressOptions longPressOptions) Deprecated.Press and hold the at the center of an element until the context menu event has fired.longPress(PointOption longPressOptions) Deprecated.Press and hold the at the center of an element until the context menu event has fired.moveTo(PointOption moveToOptions) Deprecated.Moves current touch to a new position.perform()Deprecated.Perform this chain of actions on the performsTouchActions.press(PointOption pressOptions) Deprecated.Press action on the screen.release()Deprecated.Remove the current touching implement from the screen (withdraw your touch).tap(PointOption tapOptions) Deprecated.Tap on a position.tap(TapOptions tapOptions) Deprecated.Tap on an element.Deprecated.A wait action, used as a NOP in multi-chaining.waitAction(WaitOptions waitOptions) Deprecated.Waits for specified amount of time to pass before continue to next touch action.
-
Field Details
-
parameters
Deprecated.
-
-
Constructor Details
-
TouchAction
Deprecated.
-
-
Method Details
-
press
Deprecated.Press action on the screen.- Parameters:
pressOptions- seePointOptionandElementOption.- Returns:
- this TouchAction, for chaining.
-
release
Deprecated.Remove the current touching implement from the screen (withdraw your touch).- Returns:
- this TouchAction, for chaining.
-
moveTo
Deprecated.Moves current touch to a new position.- Parameters:
moveToOptions- seePointOptionandElementOptionImportant: some older Appium drivers releases have a bug when moveTo coordinates are calculated as relative to the recent pointer position in the chain instead of being absolute.- Returns:
- this TouchAction, for chaining.
- See Also:
-
tap
Deprecated.Tap on an element.- Parameters:
tapOptions- seeTapOptions.- Returns:
- this TouchAction, for chaining.
-
tap
Deprecated.Tap on a position.- Parameters:
tapOptions- seePointOptionandElementOption- Returns:
- this TouchAction, for chaining.
-
waitAction
Deprecated.A wait action, used as a NOP in multi-chaining.- Returns:
- this TouchAction, for chaining.
-
waitAction
Deprecated.Waits for specified amount of time to pass before continue to next touch action.- Parameters:
waitOptions- seeWaitOptions.- Returns:
- this TouchAction, for chaining.
-
longPress
Deprecated.Press and hold the at the center of an element until the context menu event has fired.- Parameters:
longPressOptions- seeLongPressOptions.- Returns:
- this TouchAction, for chaining.
-
longPress
Deprecated.Press and hold the at the center of an element until the context menu event has fired.- Parameters:
longPressOptions- seePointOptionandElementOption.- Returns:
- this TouchAction, for chaining.
-
cancel
public void cancel()Deprecated.Cancel this action, if it was partially completed by the performsTouchActions. -
perform
Deprecated.Perform this chain of actions on the performsTouchActions.- Specified by:
performin interfacePerformsActions<T extends TouchAction<T>>- Returns:
- this TouchAction, for possible segmented-touches.
-
getParameters
Deprecated.Get the mjsonwp parameters for this Action.- Returns:
- A map of parameters for this touch action to pass as part of mjsonwp.
-
clearParameters
Deprecated.Clears all the existing action parameters and resets the instance to the initial state.- Returns:
- this TouchAction, for possible segmented-touches.
-