appium / appium-uiautomator2-driver

Appium driver for Android UIAutomator2
Apache License 2.0
572 stars 173 forks source link

mobile: scrollGesture "up" direction does not work #786

Closed CyberMew closed 4 months ago

CyberMew commented 4 months ago

It simply returns a "false" to indicate that it can no longer scroll. For what it's worth, I am at the bottom or middle of the scrollview.

I am using Appium Inspector and using executeScript, the executeScriptCommand is mobile; scrollGesture, and the jsonArgument is something like: { "left":0, "top":63, "width" :1080, "height":928.5, "direction":"up", "percent":0.5 }

Appium server logs shows: [AndroidUiautomator2Driver@dfbf (e236604e)] Proxying [POST /appium/gestures/scroll] to [POST http: //127.0.0.1:8200/session/5c42a02-c1b9-45cf-b19a-xxxx/ appium/gestures/scroll] with body: {"area":{"left" :0, "top" :63, "width": 1080, "height":928.5}, "direction": "up", "percent":0.5) [AndroidUiautomator2D river@dff (e236604e)] Got response with status 200: {"sessionId": "5c42a0e2-c1b9-45cf-b19a-xxxx", "value" : false} [AndroidUiautomator2Driveredfbf (e236604)] Responding to client with driver.execute() results false

Using the "down" direction, it works perfectly. I am using Applum server v2.5.4 and uiautomator2@3.5.1.

What is going on here? Driver issue or I am missing something?

Thanks.

mykola-mokhnach commented 4 months ago

These calls basically emulate appropriate API calls provided by Google's UiAutomator framework. You may check https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/gestures/Scroll.java for more details.

It might also be a good idea to check the logcat output and enable tracing of the screen pointer.

CyberMew commented 4 months ago

Yes I have the tracing enabled but it somehow doesn't scroll up. I can see my button being depressed and released. Maybe some bug with their own framework hitting the button while trying to scroll?

Anyway if this has been tested to be not an issue with this driver, we can close this ticket. For me, I workaround this problem by using performActions instead (the "hard" way but it works).