[KATALON STUDIO] Cannot swipe on device.

User information

  • Email address: thithuy.nguyen@vidiva.vn

*Summary
I need to help.
Katalon show error message: “Cannot swipe on device” when I try to execute the command: Utils.swipeBottomToTop().

This error only appears when I run on an Android device, but IOS works normally. So I think the problem is not in the code.

I tried to check action “swipe” on Mobile recoder when connecting to android device, a warning dialog box appears with error information: “Unable to perform action: Swipe”


*Operating System
MacOS Ventura 13.6.1

*Katalon Studio version
version 8.5.4

Environment (for Mobile Testing)

Environment (for Mobile testing): Android

Appium version: 2.0.1
installed drivers:
- uiautomator2@2.34.1
- xcuitest@5.11.0

Mobile platform/version under test: Android 12

1 Like

Hi,

Can you please help update the version to the latest and try again? Thank you

Thank you for your feedback, but I cannot update to the latest version of Katalon, because our company’s project requires version 8.5.4
As mentioned above, this error only appeared on my laptop, but everyone in my company performed it smoothly.

Hi @thithuy.nguyen,

Please share your execution log

12-11-2023 10:04:12 AM Utils.swipeBottomToTop()

Elapsed time: 1.286s

Cannot swipe on device. (Root cause: org.openqa.selenium.UnsupportedCommandException: Not implemented

Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'

System info: host: 'Thuys-MacBook-Pro.local', ip: 'fe80:0:0:0:c83:6093:17f5:bb47%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.16', java.version: '1.8.0_275'

Driver info: com.kms.katalon.core.appium.driver.SwipeableAndroidDriver

Capabilities {appActivity: .Settings, appPackage: com.android.settings, autoGrantPermissions: true, automationName: uiautomator2, databaseEnabled: false, desired: {appActivity: .Settings, appPackage: com.android.settings, autoGrantPermissions: true, automationName: uiautomator2, deviceId: R58R326YD9B, deviceName: samsung SM-A125F (Android 12), newCommandTimeout: 1800, platform: ANDROID, platformName: android, platformVersion: 12, systemPort: 8268, udid: R58R326YD9B}, deviceApiLevel: 31, deviceId: R58R326YD9B, deviceManufacturer: samsung, deviceModel: SM-A125F, deviceName: R58R326YD9B, deviceScreenDensity: 300, deviceScreenSize: 720x1600, deviceUDID: R58R326YD9B, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 1800, pixelRatio: 1.875, platform: LINUX, platformName: Android, platformVersion: 12, statBarHeight: 45, systemPort: 8268, takesScreenshot: true, udid: R58R326YD9B, viewportRect: {height: 1420, left: 0, top: 45, width: 720}, warnings: {}, webStorageEnabled: false}

Session ID: 85e14cfb-e425-4c06-8066-07f87b419bad

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)

at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)

at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)

at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)

at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)

at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)

at com.kms.katalon.core.appium.driver.SwipeableAndroidDriver.execute(SwipeableAndroidDriver.java:1)

at io.appium.java_client.PerformsTouchActions.performTouchAction(PerformsTouchActions.java:41)

at io.appium.java_client.TouchAction.perform(TouchAction.java:187)

at com.kms.katalon.core.mobile.helper.MobileCommonHelper.swipe(MobileCommonHelper.java:61)

at com.kms.katalon.core.mobile.keyword.builtin.SwipeKeyword$_swipe_closure1.doCall(SwipeKeyword.groovy:76)

at com.kms.katalon.core.mobile.keyword.builtin.SwipeKeyword$_swipe_closure1.call(SwipeKeyword.groovy)

at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)

at com.kms.katalon.core.mobile.keyword.builtin.SwipeKeyword.swipe(SwipeKeyword.groovy:71)

at com.kms.katalon.core.mobile.keyword.builtin.SwipeKeyword.execute(SwipeKeyword.groovy:66)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.swipe(MobileBuiltInKeywords.groovy:192)

at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords$swipe$10.call(Unknown Source)

at tingapp.Utils.swipeBottomToTop(Utils.groovy:182)

at tingapp.Utils$swipeBottomToTop$4.call(Unknown Source)

at logout.run(logout:49)

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:448)

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

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

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

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

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

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)

at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:74)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)

at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)

at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:334)

at login.run(login:25)

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:448)

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

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

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

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

at com.kms.katalon.core.common.CommonExecutor.accessTestCaseMainPhase(CommonExecutor.java:65)

at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:151)

at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:106)

at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:185)

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

at TempTestSuite1702263622245.run(TempTestSuite1702263622245.groovy:36)

)

Do I need to send details about the SwipeBottomToTop() function?

@Keyword
public static String swipeBottomToTop() {
    int device_Width = Mobile.getDeviceWidth() * 0.5
    int device_Height = Mobile.getDeviceHeight()
    int startY = device_Height * 0.7
    int endY = device_Height * 0.3
    Mobile.swipe(device_Width, startY , 0 , endY)
}

Hi @thithuy.nguyen ,

This might be a bug of KS Mobile.swipe keyword on Android with Appium v2. Please find a workaround by using this doc: