I am trying to perform a tap at coordinates x, y on a native Android app, on a device that is lower than API 17.
Here’s what I am trying:
public void selendroidTapAtCoordinate(final int x, final int y, final int secs) throws Exception {
TouchActions actions = new TouchActions(driver);
actions.down(x, y);
sleep(secs);
actions.up(x, y);
}
The error I get:
java.lang.ClassCastException: io.appium.java_client.AppiumDriver cannot be cast to org.openqa.selenium.interactions.HasTouchScreen
This is a native app and all I want to do is tap the screen at certain coordintates. Can anyone help with this?
I am using latest version of appium (1.2.3) and java client 1.7.0.
That is expected, i think u r using android in selendroid mode. so it wont support “TouchAction” methods. U need to go with pure selendroid implementations.
Did you ever figure out a workaround for this? I am having this exact issue. Seems like we can’t use the selendroid gesture implementation because the java client cannot be cast to touch actions
For pointing towards the solution. I am automating a hybrid app, Where we need to use tap on elements. With this solution I am able to use TouchAction class with selenium Webdriver and implement tap feature.