doubleTap, singleTap, tapAtPosition, pinchToZoomInAtPosition not working as expected

Hello

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)

1 Like

Hi,

Sorry for my late response due to the holidays. Can you please give us the screenshot and the version that you are using? Thank you!

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!

there r some issues with all the keywords mentioned tapAtPosition, doubleTap… throwing unhandled endpoint error. any update here? using katalon 9.2.0

even tapAndHold not working

Hi all,

Sorry for my late response. I will create ticket to investigate on this issue. Thank you all

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!

I am using Katalon Studio Free 9.4.0 with appium 2.5.1, uiautomator2@2.43.0 and xcuitest@5.14.1.

As a workaround, I have used the Appium TouchAction object.

I am using Katalon Studio version 8.5.4 with Appium 2.5.1. I had the same issue. Please support!

Hi,

Thank you all for your information. We plan to fix this in release 10.0.0. Stay tuned!

Thank you for this info. @Elly_Tran do we have an ETA for version 10.0.0 to be available for us?

Hi,

Please expect the ETA to be around Sep 26th. Thank you

Thank you for the quick response

@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

Is there a workaround for the “Tap at Position” command?

~WRD0001.jpg

Hi,

Thank you for asking. I will ask my team to see if any way possible. Back to you soon

Hi @pareng

I was able to achieve tap at position using a code as follows. Please see if this works for what you are trying to do

import io.appium.java_client.AppiumDriver
import io.appium.java_client.MultiTouchAction as MultiTouchAction
import io.appium.java_client.TouchAction

AppiumDriver<?> driver = MobileDriverFactory.getDriver()
MultiTouchAction multiTouch = new MultiTouchAction(driver)
TouchAction action1 = new TouchAction(driver)

int locationX = Mobile.getElementLeftPosition(findTestObject('Object Repository/App/locator'), 10)
int locationY = Mobile.getElementTopPosition(findTestObject('Object Repository/App/locator'), 10)
int eleWidth = Mobile.getElementWidth(findTestObject('Object Repository/App/locator'), 10)
int eleHeight = Mobile.getElementHeight(findTestObject('Object Repository/App/locator'), 10)
int startX = locationX + (eleWidth * 0.25)
int startY = locationY + (eleHeight * 0.66)
			
action1.tap(PointOption.point(startX, startY))
action1.perform()

@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

Any other ideas?

Hi,

As we are still working on supporting uiautomator v3 in KS, you can try to use uiautomator v2:

  1. Uninstall uiautomator2
  2. Install uiautomator2@2.45.1
  3. Remove the installed uiautomator2 server in the device

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!