To press, hold, and scroll down on a webpage using WebdriverIO and Appium, follow these steps:
touchAction
method to create a touch action chain.press
and wait
actions to the touch action chain to press and hold an element on the webpage.moveTo
action to the touch action chain to scroll down on the webpage.Here is some sample code to achieve this:
const touchActions = new webdriverio.TouchAction();
touchActions
.press({x: 200, y: 400})
.wait(2000)
.moveTo({x: 200, y: 200})
.release();
browser.performActions([touchActions]);
In this example, the press
action presses and holds an element at coordinates (200, 400) on the webpage. The wait
action waits for 2 seconds before executing the next action, which is the moveTo
action that scrolls down on the webpage to coordinates (200, 200). Finally, the release
action releases the touch. The performActions
method executes the touch action chain.
Asked: 2022-08-16 11:00:00 +0000
Seen: 8 times
Last updated: Jul 10 '22