1

I am trying to scroll the android screen using touchAction in webdriverio. Am using the following code to perform action but it doesn't work.

driver.touchAction([ {action:'press',x:1052,y:1567}, { action: 'moveTo',x:1041, y:689}, 'release' ])

Any suggestion would be helpful

2 Answers 2

3

Try using longPress instead of press. You may also need to preface the command with await due to to asynchronous nature. For example:

await driver.touchAction([ {action: 'longPress', x: 0, y: 1000}, { action: 'moveTo', x: 0, y: 10}, 'release' ]);
Sign up to request clarification or add additional context in comments.

Comments

0

Apart from the touchAction, the touchPerform can chain operations altogether.

await driver.touchPerform([
    { action: "longPress", options: { x: 414, y: 1285 } },
    { action: "moveTo", options: { x: 427, y: 226 } },
    { action: "release", options: {} },
    {
      action: "wait",
      options: {
        ms: 100,
      },
    },
    { action: "longPress", options: { x: 414, y: 1285 } },
    { action: "moveTo", options: { x: 427, y: 226 } },
    { action: "release", options: {} },
  ]);

1 Comment

Appium 2.4.1, WebdriverIO 8.30.0, getting ERROR webdriver: Request failed with status 405 due to unknown method: Not implemented when trying to .touchPerform()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.