Appium(Android Mobile) : Click button using X Y coordinate(if can't find ID or Xpath)?

2 Answers 2


I would probably find a element you can find and use an offset from that location. See this to get a Point from element: http://appium.io/docs/en/commands/element/attributes/location/

To click on some coordinates:

TouchAction touchAction=new TouchAction(driver);
touchAction.tap(xPoint, yPoint).perform();

Code from: https://discuss.appium.io/t/tapping-on-the-screen-by-using-coordinates/5529/8

  • 1
    Thanks for your comment small correction to your code this is working fine. TouchAction touchAction=new TouchAction(driver); touchAction.tap(PointOption.point(120, 1456)).perform();
    – lak
    May 26, 2020 at 14:48

You could also try console.log(driver.getPageSource()) to target element type

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.