[Android] Vertical scroll is not working
See original GitHub issueThe problem
I upgraded appium version from 1.6.5 to 1.7.0 & node version to 8.5.0, after which I find that the scroll is not working for android.
Note: Initially with 1.6.5, it was working. But after upgrading 1.7.0 and reverting to 1.6.5, android scroll stopped working. But it working for IOS.
If anyone could advise, that’ll be really helpful.
Thanks, Brad
Environment
- Appium version - 1.7.7
- Last Appium version that did not exhibit the issue (if applicable): 1.6.5
- Desktop OS/version used to run Appium: Mac OS sierra (10.12.6)
- Node.js version (unless using Appium.app|exe): v8.5.0
- Mobile platform/version under test: Android
- Real device or emulator/simulator: Nexus_5x_API_25 (emulator)
- Appium CLI or Appium.app|exe:
Details
If necessary, describe the problem you have been experiencing in more detail.
Following is the Appium server logs generated when TouchAction is called. There are no error logs displayed.
[androidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true} [debug] [AndroidBootstrap] Received command result from bootstrap [debug] [MJSONWP] Responding to client with driver.pressKeyCode() result: true [HTTP] <-- POST /wd/hub/session/e0957ac3-f6cf-4462-8886-009845b2c2a9/appium/device/press_keycode 200 1139 ms - 76 [HTTP] --> GET /wd/hub/session/e0957ac3-f6cf-4462-8886-009845b2c2a9/window/current/size {} [debug] [MJSONWP] Calling AppiumDriver.getWindowSize() with args: [“current”,“e0957ac3-f6cf-4462-8886-009845b2c2a9”] [debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}} [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“getDeviceSize”,“params”:{}} [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getDeviceSize [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“height”:1794,“width”:1080}} [debug] [AndroidBootstrap] Received command result from bootstrap [debug] [MJSONWP] Responding to client with driver.getWindowSize() result: {“height”:1794,“width”:1080} [HTTP] <-- GET /wd/hub/session/e0957ac3-f6cf-4462-8886-009845b2c2a9/window/current/size 200 32 ms - 100 start =897 end =358 [HTTP] --> POST /wd/hub/session/e0957ac3-f6cf-4462-8886-009845b2c2a9/touch/perform {“actions”:[{“action”:“press”,“options”:{“x”:0,“y”:897}},{“action”:“wait”,“options”:{“ms”:2000}},{“action”:“moveTo”,“options”:{“x”:0,“y”:358}},{“action”:“release”,“options”:{}}]} [debug] [MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“press”,“options”:{“x”:0,“y”:897}},{“action”:“wait”,“options”:{“ms”:2000}},{“action”:“moveTo”,“options”:{“x”:0,“y”:358}},{“action”:“release”,“options”:{}}],“e0957ac3-f6cf-4462-8886-009845b2c2a9”] [debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“swipe”,“params”:{“startX”:0,“startY”:897,“endX”:0,“endY”:358,“steps”:56}} [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“swipe”,“params”:{“startX”:0,“startY”:897,“endX”:0,“endY”:358,“steps”:56}} [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: swipe [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Display bounds: [0,0][1080,1794] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Display bounds: [0,0][1080,1794] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Swiping from [x=540.0, y=897.0] to [x=540.0, y=358.0] with steps: 56 [debug] [AndroidBootstrap] Received command result from bootstrap [debug] [MJSONWP] Responding to client with driver.performTouch() result: true [HTTP] <-- POST /wd/hub/session/e0957ac3-f6cf-4462-8886-009845b2c2a9/touch/perform 200 1349 ms - 76 [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true} [HTTP] --> POST /wd/hub/session/e0957ac3-f6cf-4462-8886-009845b2c2a9/timeouts {“type”:“implicit”,“ms”:10000} [debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,10000,“e0957ac3-f6cf-4462-8886-009845b2c2a9”] [debug] [BaseDriver] Set implicit wait to 10000ms [debug] [MJSONWP] Responding to client with driver.timeouts() result: null [HTTP] <-- POST /wd/hub/session/e0957ac3-f6cf-4462-8886-009845b2c2a9/timeouts 200 2 ms - 76 [HTTP] --> POST /wd/hub/session/e0957ac3-f6cf-4462-8886-009845b2c2a9/element {“using”:“accessibility id”,“value”:“uia-personal-rego-step2-home-address”} [debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“accessibility id”,“uia-personal-rego-step2-home-address”,“e0957ac3-f6cf-4462-8886-009845b2c2a9”] [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator [debug] [BaseDriver] Waiting up to 10000 ms for condition
Code To Reproduce Issue [ Good To Have ]
Capabilities are given below
function AppiumDriver setUp(url) { capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"emulator-5554"); capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"android"); capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION,"7.1.1"); capabilities.setCapability(MobileCapabilityType.APP, appForAndroid.getAbsolutePath()); capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 30); capabilities.setCapability(MobileCapabilityType.PLATFORM, "android"); capabilities.setCapability("noReset", true); androidDriver = new AndroidDriver<>(url, capabilities); androidDriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); return androidDriver;
Code for scrolling down
public void scrollScreenToEnd(AppiumDriver driver, Integer relativeYPositionOfPreviousField) { TouchAction swipe = new TouchAction(driver).press(0, relativeYPositionOfPreviousField).waitAction(Duration.ofSeconds(3)).moveTo(0, relativeYPositionOfPreviousField - 100).release(); swipe.perform(); }
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top GitHub Comments
i would say this is still a bug for appium, what you found is a workaround
Thanks @lanzelot1989, you made my day. I’ve found the issue. The issue was about the value that was set for x co-ordinate wasn’t working. But it was working earlier with appium 1.6.5. Not sure why this is not working for android now. But if I mention size.Width - 10, it works good. Closing this now.