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 java.lang.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 Classes Modifier and Type Class Description protected class
TouchAction.ActionParameter
Deprecated.Just holds values to eventually return the parameters required for the mjsonwp.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<TouchAction.ActionParameter>
parameters
Deprecated.
-
Constructor Summary
Constructors Constructor Description TouchAction(PerformsTouchActions performsTouchActions)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
cancel()
Deprecated.Cancel this action, if it was partially completed by the performsTouchActions.protected T
clearParameters()
Deprecated.Clears all the existing action parameters and resets the instance to the initial state.protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
getParameters()
Deprecated.Get the mjsonwp parameters for this Action.T
longPress(LongPressOptions longPressOptions)
Deprecated.Press and hold the at the center of an element until the context menu event has fired.T
longPress(PointOption longPressOptions)
Deprecated.Press and hold the at the center of an element until the context menu event has fired.T
moveTo(PointOption moveToOptions)
Deprecated.Moves current touch to a new position.T
perform()
Deprecated.Perform this chain of actions on the performsTouchActions.T
press(PointOption pressOptions)
Deprecated.Press action on the screen.T
release()
Deprecated.Remove the current touching implement from the screen (withdraw your touch).T
tap(PointOption tapOptions)
Deprecated.Tap on a position.T
tap(TapOptions tapOptions)
Deprecated.Tap on an element.T
waitAction()
Deprecated.A wait action, used as a NOP in multi-chaining.T
waitAction(WaitOptions waitOptions)
Deprecated.Waits for specified amount of time to pass before continue to next touch action.
-
-
-
Field Detail
-
parameters
protected java.util.List<TouchAction.ActionParameter> parameters
Deprecated.
-
-
Constructor Detail
-
TouchAction
public TouchAction(PerformsTouchActions performsTouchActions)
Deprecated.
-
-
Method Detail
-
press
public T press(PointOption pressOptions)
Deprecated.Press action on the screen.- Parameters:
pressOptions
- seePointOption
andElementOption
.- Returns:
- this TouchAction, for chaining.
-
release
public T release()
Deprecated.Remove the current touching implement from the screen (withdraw your touch).- Returns:
- this TouchAction, for chaining.
-
moveTo
public T moveTo(PointOption moveToOptions)
Deprecated.Moves current touch to a new position.- Parameters:
moveToOptions
- seePointOption
andElementOption
Important: 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:
- Appium Issue #7486 for more details.
-
tap
public T tap(TapOptions tapOptions)
Deprecated.Tap on an element.- Parameters:
tapOptions
- seeTapOptions
.- Returns:
- this TouchAction, for chaining.
-
tap
public T tap(PointOption tapOptions)
Deprecated.Tap on a position.- Parameters:
tapOptions
- seePointOption
andElementOption
- Returns:
- this TouchAction, for chaining.
-
waitAction
public T waitAction()
Deprecated.A wait action, used as a NOP in multi-chaining.- Returns:
- this TouchAction, for chaining.
-
waitAction
public T waitAction(WaitOptions waitOptions)
Deprecated.Waits for specified amount of time to pass before continue to next touch action.- Parameters:
waitOptions
- seeWaitOptions
.- Returns:
- this TouchAction, for chaining.
-
longPress
public T longPress(LongPressOptions longPressOptions)
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
public T longPress(PointOption longPressOptions)
Deprecated.Press and hold the at the center of an element until the context menu event has fired.- Parameters:
longPressOptions
- seePointOption
andElementOption
.- Returns:
- this TouchAction, for chaining.
-
cancel
public void cancel()
Deprecated.Cancel this action, if it was partially completed by the performsTouchActions.
-
perform
public T perform()
Deprecated.Perform this chain of actions on the performsTouchActions.- Specified by:
perform
in interfacePerformsActions<T extends TouchAction<T>>
- Returns:
- this TouchAction, for possible segmented-touches.
-
getParameters
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> 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
protected T clearParameters()
Deprecated.Clears all the existing action parameters and resets the instance to the initial state.- Returns:
- this TouchAction, for possible segmented-touches.
-
-