appiumwdio-v5

Trying to scroll using appium + wdio


Have been trying to scroll down the page for ages. I can see the pointer moving on the android emulator device (enabled in the options) but it's not moving the page down so I cannot click the element that is below the fold, it cannot find the element. Any help appreciated.

I'm doing:

await el.touchAction([ {action: 'press', x: 50, y: 1500}, {action: 'moveTo', x: 50, y: 1300}, 'release' ])

and have tried numerous other things. It doesn't work on ios nor android. I'd have thought this was so fundamental.


Solution

  • I have found a way that works for me with very similar code, just added a wait between press and moveTo:

       await el.touchAction([
      { action: 'press', x: 540, y: 900 },
      { action: 'wait', ms: 500 },
      { action: 'moveTo', x: 540, y: 480 },
      'release']);