Hey there,
In my swipe with js experiences, scroll
method has a slower swipe, and I have managed to increase the duration with dragFromToForDuration
I’m leaving the code blocks below, hope that it may help. I had some problems on 1.6.4 but worked on 1.6.5
public void scrollDown_js() {
Map<String, Object> params = new HashMap<>();
params.put("direction", "down");
driver.executeScript("mobile: scroll", params);
}
public void dragFromToForDuration(By elementBy,int xStartRatio, int yStartRatio, int xEndRatio, int yEndRatio, double durationSecond){
MobileElement element = waitForElement(elementBy);
Dimension d = driver.manage().window().getSize();
int height = d.height;
int width = d.width;
int swipeStartWidth = (width * xStartRatio)/100;
int swipeEndWidth = (width * xEndRatio)/100;
int swipeStartHeight = (height * yStartRatio) / 100;
int swipeEndHeight = (height * yEndRatio) / 100;
Map<String, Object> params = new HashMap<>();
params.put("duration", durationSecond);
params.put("fromX", swipeStartWidth);
params.put("fromY", swipeStartHeight);
params.put("toX", swipeEndWidth);
params.put("toY", swipeEndHeight);
params.put("element", element.getId());
driver.executeScript("mobile: dragFromToForDuration", params);
}