TouchAction not working with java-client 6.0.0 version and above in Appium


#1

Hi

I am unable to use TouchAction for tapping on screen with co ordinates with java-client version 6.0.0 and above and used respective selenium-java version
Getting below issue while compiling .

method io.appium.java_client.TouchAction.tap(io.appium.java_client.touch.TapOptions) is not applicable
(actual and formal argument lists differ in length)
method io.appium.java_client.TouchAction.tap(io.appium.java_client.touch.offset.PointOption) is not applicable
(actual and formal argument lists differ in length)

Please let me know any solutions and help me on this to get rid of this issue.

Thanks
Dinesh B M


#2

Make sure to use the latest implementation of touch function which is:

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

Also another problem that I experienced when I got exactly those errors, was that gradle didn’t actually import the latest versions of java-client, when I checked the libraries the old one was still there, I had to manually remove if from the project and then refresh the gradle project to force it to install the 7.0.0 version after that the pointOption finally worked. Hope this helps.