Appium tap(int x, int y) function seems to be deprecated. Any replacements?

touch action appium
appium tap coordinates
horizontal swipe in appium
difference between tap and click in appium
appium tap not working
vertical swipe in appium
double tap in appium
appium touch action library

I'm trying to automate an Android game and for that I'm using X,Y co-ordinates to make a button click, as identifying elements through ID, Xpath etc. is not possible for games. I'm using TouchAction tap(int x, int y) method (Appium Method) for achieving this. But unfortunately this method tap(int x, int y) seems to be deprecated. The other options replacing this looks to be --> touchAction.tap(PointOptions tapOptions) and touchAction.tap(TapOptions tapOptions). The same is the case with touchAction.press as well.

My code to touch a specific button looks like this:

TouchAction touchAction = new TouchAction(driver);
touchAction.tap(1280, 1013).perform();

Here, the X,Y values are found using Touch points in Android Device [Developer Options > Show pointer location]

Can anyone suggest a better way to achieve the same using non deprecated method? Thanks!

You can view the TouchAction documentation here:

https://appium.github.io/java-client/io/appium/java_client/TouchAction.html

Here's the method that replaced the tap() you are using:

https://appium.github.io/java-client/io/appium/java_client/TouchAction.html#tap-io.appium.java_client.touch.offset.PointOption-

and here is the PointOption documentation, which is the new parameter to use with tap():

https://appium.github.io/java-client/io/appium/java_client/touch/offset/PointOption.html

So to answer your question, you have two choices with PointOption:

  1. Using PointOption.point(x, y), which is a static instance of PointOption with those coordinate values

TouchAction touchAction = new TouchAction(driver);
touchAction.tap(PointOption.point(1280, 1013)).perform()

  1. Using PointOption().withCoordinates(x, y), which returns a reference to the PointOption instance after setting those coordinate values

TouchAction touchAction = new TouchAction(driver);
touchAction.tap(new PointOption().withCoordinates(1280, 1013)).perform()

java - Tap deprecated in Appium hybrid app, I have issue with deprecated tap in Appium , because eclipse says that "tap" with to tap the location coordinates , and can`t find the new function for new "tap with coordinates" new TouchAction(localdriver).tap(point(xPoint, yPoint)). perform(); both for "press" and "tap" is still methods tap(x,y) / press(x,y) are deprecated. Tab by using x,y coordinates; Press by using an element and duration (in seconds) Press by using x,y coordinates, and duration (in seconds) Horizontal swipe by using start and end percentage of the screen and an anchor for the height. Vertical swipe by using start and end percentage of the screen and an anchor for the width.

As different Options are introduced after an update , This will Work for you

new TouchAction(driver).tap(PointOption.point(x,y)).waitAction(waitOptions(Duration.ofMillis(duration))).moveTo(PointOption.point(x, y)).release().perform();

    }

Appium Mobile Actions | Swipe | Tap | MultiTouch, I will explain how to do some appium mobile actions such as swipe, tap, -tapint -x-int-y-function-seems-to-be-deprecated-any-replacements. Teams. Q&A for Work. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information.

An alternative to the deprecated tap/press function is the 'longPress' function. Here's the function :

public T longPress(LongPressOptions longPressOptions) {
    ActionParameter action = new ActionParameter("longPress", longPressOptions);
    parameterBuilder.add(action);
    //noinspection unchecked
    return (T) this;
}

For more information, see : https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/TouchAction.java

Replacement for Deprecated Press, Moveto Functions in 6.0.0 , However, its display an error "these 2 were deprecated" and the method waitAction(WaitOptions) in the type TouchAction is no in the type TouchAction is not applicable for the arguments (int). Saw that AppiumDriver press and MobileElement moveto functions were marked deprecated, is there a� 0 Appium tap(int x, int y) function seems to be deprecated. Any replacements? Dec 31 '19. 0 after which annotaion we can use @Override annotation? Oct 3 '19.

How to use touch action in new java client 6.0.0 , Using latest java client i am not able to use touch action. can anyone new TouchAction(localdriver).tap(point(xPoint, yPoint)).perform(); using above code it's showing in eclipse that press and move to method has been Deprecated. On some iPhones I'm not able to, dont know why, but although the� from appium.webdriver.common.touch_action import TouchAction # actions = TouchAction(driver) actions.tap(element) actions.perform()

io.appium.java_client.TouchAction.tap java code examples, No questions with score of 5 or more. Top Answers. 15 � Appium tap(int x, int y) function seems to be deprecated. Any replacements? stackoverflow.com� public static PointOption point(int xOffset, int yOffset) It creates a built instance of PointOption which takes x and y coordinates. This is offset from the upper left corner of the screen.

User Taryn, Accept all iOS alerts automatically if they pop up. AUTO_DISMISS_ALERTS - Static variable in interface io.appium.java_client.remote. The tap event is not working for me as well event even when clicking the element directly (without coordinates) using Appium 1.6.2 Copy link Quote reply Author

Comments
  • I am getting an error for the first choice as "Method has not yet been implemented" what would be the cause?
  • So, in this function, where should I pass the X,Y coordinates. What parameters does the (LongPressOptions longPressOptions) accept? There is another tap function which is not deprecated as far as I read from Eclipse [touchAction.tap(PointOptions tapOptions) and touchAction.tap(TapOptions tapOptions).] but I'm unaware what needs to be passed as its parameters.