1

For my e2e tests on iOS, I'm running some appium commands like the following examples:

browser.execute("mobile: scroll", {
   element: elementId,
   toVisible: true
});

or simply

browser.execute("mobile: scroll", {
  direction: "up"
});

but I noticed that the scroll incredibly slow. Is there a way to increase the speed and gain time running my tests? I have already check out the documentation here but haven't found anything interesting.

Any clue ?

Laura
  • 8,100
  • 4
  • 40
  • 50

1 Answers1

0

You could consider using mobile:swipe command, it should be working much faster:

Map<String, Object> params = new HashMap<>();
params.put("direction", "up");
//if you are scrolling to some MobileElement
if (myElement != null) {
    params.put("element", ((RemoteWebElement) myElement ).getId());
}
browser.executeScript("mobile: swipe", params);

There is also Swipe command available via SeeTest Appium Extension which is easier to use in terms of syntax

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • It does solve the problem for a basic `scroll` up but not really when I need to reach a specific position. – Laura Aug 15 '19 at 15:03