Mobile Tap - position + debugging protip

Ok guys. I was struggling with some basic tests on my mobile application when I turned on Android Device Pointer location and Show taps. Then I discovered that when Tap action is executed, it taps on the corner of element:
example

So my guess is that in some very rare cases (not every device, OS, webview) something goes wrong and it does not click on clickable area of element like here:
example2

What are your thoughts?
Why tapping is not executed in the center of element?
Is there (in any package) a function to tap it on the center?

In my opinion, this hint should be added to Tips and Tricks or somewhere else - it would speed up many debugging sessions :smiley:

Ok, I found on forum proper function here.

`import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.mobile.helper.MobileElementCommonHelper
import io.appium.java_client.MobileElement

MobileElement element = MobileElementCommonHelper.findElement(findTestObject(‘element id’), 10)
element.click()`
works

1 Like