Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appium - Scroll to a button not working

So I've been trying to scroll down to a Submit button on my Android app(made using Kony Visualiser) but for some reason nothing seems to be working. So far I've tried:

  • touchPerform, touchAction, findElementbyAndroidUiAutomator, changing longPress to press, adding a wait action, reversing the x and y figures, changing the values and several other suggestions I've seen online.

Appium version: v1.8.0

My current JavaScript code works when I am scrolling through other elements (segment) and only doesn't work in this specific situation where I'm trying to scroll down a scrollable flexbox.

Here is a snippet of my current code:

.touchPerform([
  { action: 'longPress', options: { x: 50, y: 1800 }},
  { action: 'moveTo', options: { x: 50, y: 0 }},
  { action: 'release' }
])

Any suggestions would be greatly appreciated!

like image 794
Reina Reinhart Avatar asked Feb 02 '26 00:02

Reina Reinhart


2 Answers

I sometimes still use driver.swipe even tough it's getting deprecated.

driver.swipe(width, startPoint, width, endPoint, duration);

The better way would be:

TouchAction action = new TouchAction(driver); action.press(startX, startY).moveTo((endX - startX), (endY-startY)).release().perform();

like image 125
buckalot Avatar answered Feb 04 '26 14:02

buckalot


Reina: Make sure you keep flex-scroll container scroll direction set to vertical/both, layout-type vertical. Thanks!

like image 35
TechieTan Avatar answered Feb 04 '26 12:02

TechieTan