Open sshock opened 4 years ago
Since https://github.com/appium/appium-uiautomator2-server/commit/6cf1e05c7578c2118c7d7f45ed354df993090f82 the code now calculating element bounds for clicking with respect to simpleBoundsCalculation
setting value. So you could either try to set this setting to false
while clicking or use touch actions to calculate the click coordinates in the client code.
Also, it makes sense to enable touches assistance in dev settings, so then you could see where click actually happens.
Great, thanks I will try your suggestions!
I'm curious though, do you find it surprising that an EditText inside a NumberPicker would not have the correct bounds with simpleBoundsCalculation
true
?
Also, can you explain the reasoning for changes in 6cf1e05? Does it clean up the code? Or is it supposed to improve performance? If it's for performance it might be one step forward one step back if it means we have to stop using simpleBoundsCalculation. Well, I guess it's not that bad since we can turn it on and off as needed and probably still have it be on most of the time...
I assume this particular control has a scrollable parent, which affects its actual bounds. And click is performed exactly in the middle of this bounds rect.
Does it clean up the code?
It fixes a potential issue where bounds shown in XML page source are not in sync with actual element bounds used for making operations like click
on it. It also makes sense from performance perspective.
@mykola-mokhnach unfortunately, setting simpleBoundsCalculation
to false
didn't help.
I made these two screen recordings to first, illustrate the problem, and second, show how it was working before:
v4.12.3 broken: https://drive.google.com/file/d/1CuRoOHvu6J_DTD9eqyMw_SKser9eMZbL/view
v4.12.2 working: https://drive.google.com/file/d/1uDGE3Coll0U3bvbito2k3_U43RaVdlG6/view
Thanks for the detailed videos. It looks like the problem is not with coordinates, but rather clicking logic itself. Let me try some other approach
Could you please try if https://github.com/appium/appium-uiautomator2-server/pull/378 fixes the clicking?
Could you please try if #378 fixes the clicking?
Sure thing. I should get time to test it this afternoon...
Could you please try if #378 fixes the clicking?
@mykola-mokhnach it works!
Cool, I've published the patch
Something happened in v4.12.3 (likely in 6cf1e05) that has made it so I can no longer click on some EditText elements for month, day, and year in an app I am automating.
I am still able to find the elements, but when I try to click on them nothing happens. Normally when clicking on them the element becomes focused and the text gets highlighted as seen in the screenshot below.
I'm not sure why I can no longer click on these because they are EditText elements and they do have clickable true attribute.
The screenshot and scene tree below are after clicking on day "01" using uiautomator2 v4.12.2. With v4.12.3 I can't click on it.