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 Classes
    Modifier and Type
    Class
    Description
    protected class 
    Deprecated.
    Just holds values to eventually return the parameters required for the mjsonwp.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Deprecated.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TouchAction(PerformsTouchActions performsTouchActions)
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated.
    Cancel this action, if it was partially completed by the performsTouchActions.
    protected T
    Deprecated.
    Clears all the existing action parameters and resets the instance to the initial state.
    protected Map<String,List<Object>>
    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.
    Deprecated.
    Perform this chain of actions on the performsTouchActions.
    press(PointOption pressOptions)
    Deprecated.
    Press action on the screen.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • press

      public T press(PointOption pressOptions)
      Deprecated.
      Press action on the screen.
      Parameters:
      pressOptions - see PointOption and ElementOption.
      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 - see PointOption and ElementOption 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:
    • tap

      public T tap(TapOptions tapOptions)
      Deprecated.
      Tap on an element.
      Parameters:
      tapOptions - see TapOptions.
      Returns:
      this TouchAction, for chaining.
    • tap

      public T tap(PointOption tapOptions)
      Deprecated.
      Tap on a position.
      Parameters:
      tapOptions - see PointOption and ElementOption
      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 - see WaitOptions.
      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 - see LongPressOptions.
      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 - see PointOption and ElementOption.
      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 interface PerformsActions<T extends TouchAction<T>>
      Returns:
      this TouchAction, for possible segmented-touches.
    • getParameters

      protected Map<String,List<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.