When I use doubleTap, singleTap, tapAtPosition, pinchToZoomInAtPosition user actions to test a mobile app, these actions are either not recognized at all or perform a different action than what the name states. See examples below.
1. Example 01 - the following code performs single tap instead of pinch to zoom
int intLocationX = Mobile.getElementLeftPosition(findTestObject(‘Object Repository/App/RapidAI/Mobile/iOS/xyz/xyz/XCUIElementTypeOther - MPR Axial Plane’), 10)
int intLocationY = Mobile.getElementTopPosition(findTestObject(‘Object Repository/App/xyz/Mobile/iOS/xyz/xyz/XCUIElementTypeOther - ele1’), 10)
int intWidth = Mobile.getElementWidth(findTestObject(‘Object Repository/App/xyz/Mobile/iOS/xyz/xyz/XCUIElementTypeOther - ele1’), 10)
int intHeight = Mobile.getElementHeight(findTestObject(‘Object Repository/App/xyz/Mobile/iOS/xyz/xyz/XCUIElementTypeOther - ele1’), 10)
int intStartX = intLocationX + (intWidth * 0.25)
int intStartY = intLocationY + (intHeight * 0.25)
Mobile.pinchToZoomInAtPosition(intStartX, intStartY, 20)
2. Example 02 - the following code performs single tap instead of double tap
Mobile.sendKeys(findTestObject(‘Object Repository/App/xyz/Mobile/iOS/xyz/xyz/XCUIElementTypeOther - ele1’), ‘doubleTap’)
3. Example 03 - The following code does not result in any action
Mobile.sendKeys(findTestObject(‘Object Repository/App/xyz/Mobile/iOS/xyz/xyz/XCUIElementTypeOther - ele1’), ‘singleTap’)
4. Example 04 - The following code performs double tap instead of single tap
Mobile.tap(findTestObject(‘Object Repository/App/xyz/Mobile/iOS/xyz/xyz/XCUIElementTypeOther - ele1’), 10)
I got the same issue once on my latest OS version mobile devices on Katalon 9.3.0.
Here are all the tools I am using:
Pixel 6 (Android 14)
iPhone SE 3rd (iOS 17.3.1)
MacOS: 14.3.1
Xcode: 15.2
Appium: 2.5.1
uiautomator2: 3.0.1
xcuitest: 7.2.0
Tested on the same model (Pixel 6) but a different OS version (Android 13) and it works fine. Unfortunately, I don’t have another iPhone to test it but it was working before I upgraded.
The core error messages are as below:
iOS:
com.kms.katalon.core.exception.StepFailedException: Failed to tap at [500, 50]
at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.stepFailed(MobileKeywordMain.groovy:38)
at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)
at com.kms.katalon.core.mobile.keyword.builtin.TapAtPositionKeyword.tapAtPosition(TapAtPositionKeyword.groovy:72)
at com.kms.katalon.core.mobile.keyword.builtin.TapAtPositionKeyword.execute(TapAtPositionKeyword.groovy:64)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.tapAtPosition(MobileBuiltInKeywords.groovy:2610)
Caused by: org.openqa.selenium.UnsupportedCommandException: Unhandled endpoint: /session/55ABAE3C-F2EB-45E8-B9A0-361302E3C314/touch/perform -- http://127.0.0.1:63021/ with parameters {
wildcards = (
"session/55ABAE3C-F2EB-45E8-B9A0-361302E3C314/touch/perform"
);
}
Android:
com.kms.katalon.core.exception.StepFailedException: Failed to tap at [500, 50]
at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.stepFailed(MobileKeywordMain.groovy:38)
at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)
at com.kms.katalon.core.mobile.keyword.builtin.TapAtPositionKeyword.tapAtPosition(TapAtPositionKeyword.groovy:72)
at com.kms.katalon.core.mobile.keyword.builtin.TapAtPositionKeyword.execute(TapAtPositionKeyword.groovy:64)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.tapAtPosition(MobileBuiltInKeywords.groovy:2610)
Caused by: org.openqa.selenium.UnsupportedCommandException: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
Let me know if your need more information, thank you!
Hi all, There is a breaking change of the uiautomator2 on v3.0.0. We have recognized this problem and plan to support new uiautomation version soon. I will update more on this if anything new. Thank you!
@Elly_Tran Is there a workaround for the “Tap at Position” command, I just want to be able to tap at a specific coordinance (X,Y) in the mobile device’s screen
@puranik I’ve tried to use your code sample and it still does not work for me both with UiAutomator2@3.0.0 & UiAutomator2@2.43.0
Here is an excerpt from the appium.log:
[38;5;0m[HTTP] [0m [37m<-- POST /wd/hub/session/49a6be96-8eb6-41c2-ab36-9d847ea94a52/appium/device/activate_app [39m [32m200 [39m [90m139 ms - 14 [39m
[38;5;0m[HTTP] [0m [90m [39m
[38;5;0m[HTTP] [0m [37m–> [39m [37mPOST [39m [37m/wd/hub/session/49a6be96-8eb6-41c2-ab36-9d847ea94a52/touch/perform [39m
[38;5;0m[HTTP] [0m [90m{“actions”:[{“action”:“tap”,“options”:{“x”:30,“y”:30}}]} [39m
[38;5;48m[AndroidUiautomator2Driver@b7b3 (49a6be96)] [0m Got response with status 404: {“sessionId”:null,“value”:{“error”:“unknown command”,“message”:“The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource”,“stacktrace”:"io.appium.uiautomator2.common.exceptions.UnknownCommandException: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:84)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)\n\tat io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandler…
[38;5;0m[HTTP] [0m [37m<-- POST /wd/hub/session/49a6be96-8eb6-41c2-ab36-9d847ea94a52/touch/perform [39m [33m404 [39m [90m26 ms - 3530 [39m
[38;5;0m[HTTP] [0m [90m [39m
Hi @Elly_Tran I am having the same issue when I use these actions but more strangely it seems that when I use only Tap action the step is successful but not taping on the device. I saw that there will be a release for fixing it in September, so should we just do nothing until then?
I’m using Katalon Studio Enterprise testing on a real device - iPad Air 5th gen.
Thank you!