Scroll / Swipe Action Android and iOS #10994
Replies: 5 comments 15 replies
-
Check out some of the helpers we have in the Appium boilerplate project. They might help you! |
Beta Was this translation helpful? Give feedback.
-
Ah thankyou! hm its using TypeScript ya, because im using javascript, many people use typescript rightnow should i change too for project wdio? @christian-bromann |
Beta Was this translation helpful? Give feedback.
-
Any update for this one. I'm using this code but it works on ios only, any solution for Android ? |
Beta Was this translation helpful? Give feedback.
-
Thank you!!! This resolves every problem. |
Beta Was this translation helpful? Give feedback.
-
i get this from the helper file that @christian-bromann provided import { driver } from '@wdio/globals'
await driver
// a. Create the event
.action('pointer')
// b. Move finger into start position
.move(fromX, fromY) // This can also be written as .move({ x: fromX, y: fromY }) which allows you to add more options
// c. Finger comes down into contact with screen
.down() // This can also be written as .down({ button:0 }) which allows you to add more options
// d. Pause for a little bit
.pause(100)
// e. Finger moves to end position
// IMPORTANT. The default duration, if you don't provide it, is 100ms. This means that the movement will be so fast that it:
// - might not be registered
// - might not have the correct result on longer movements.
// Short durations will move elements on the screen over longer move coordinates very fast.
// Play with the duration to make the swipe go slower / faster
.move({ duration: 500, x: toX, y: toY })
// f. Finger gets up, off the screen
.up() // this can also be written as .up({ button:0 }) which allows you to add more options
// g. Perform the action
.perform(); here's clean example import { driver } from '@wdio/globals'
await driver
.action('pointer')
.move({ x: 250, y: 600 })
.down()
.pause(100)
.move({ duration: 500, x: 250, y: 150 })
.up()
.perform(); idk why such simple task like scrolling is not properly documented on wdio appium website btw I'm using wdio + appium + UiAutomator2 |
Beta Was this translation helpful? Give feedback.
-
Hi guys, can i ask something about scroll or swipe action on webdriverio for android and ios? because i already try many ways but still not working, i working on project wdio android and ios with appium cucumber for automation mobile app
Beta Was this translation helpful? Give feedback.
All reactions