How to Perform Multi-touch Actions in Mobile App


This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/docs/handle_multi_touch_action.html

Hi! I’m getting this when I try to run this test case, which is strange, because I have copied it straight from https://docs.katalon.com/katalon-studio/docs/handle_multi_touch_action.html#script-mode. It is running against an Android Studio Emulator:
06-09-2020 04:59:55 PM Test Cases/Needs Work/Multitouch Tester Tutorial Thing

Elapsed time: 36.252s

Test Cases/Needs Work/Multitouch Tester Tutorial Thing FAILED.

Reason:

groovy.lang.MissingMethodException: No signature of method: io.appium.java_client.TouchAction.press() is applicable for argument types: (java.lang.Integer, java.lang.Integer) values: [307, 390]

Possible solutions: press(io.appium.java_client.touch.offset.PointOption), grep(), every(), perform(), print(java.lang.Object), grep(java.lang.Object)

at Multitouch Tester Tutorial Thing.run(Multitouch Tester Tutorial Thing:142)

at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)

at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)

at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)

at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)

at TempTestCase1591739992011.run(TempTestCase1591739992011.groovy:23)

Any idea what’s wrong?

Thanks,
Will

TouchAction.press(X, Y) is obsolated in appium-javaclient.7.0.0

Please change to:

import io.appium.java_client.touch.offset.PointOption

action.press(PointOption.point(X1, Y1)).waitAction(5000).release()

References: https://javadoc.io/doc/io.appium/java-client/7.0.0/io/appium/java_client/TouchAction.html

Btw, we will update our document later. Thanks for your report.

Thanks @duyluong! @Igor_Makarchuk also helped troubleshoot, building upon your suggestion, and this ended up working (thanks Igor!):

...
import io.appium.java_client.TouchAction as TouchAction
import io.appium.java_client.touch.WaitOptions
import io.appium.java_client.touch.offset.PointOption
...
action1.press(PointOption.point(X1, Y1)).waitAction(WaitOptions.waitOptions(Duration.ofMillis(5000))).release()
...