IOSDriver - action.press(150, 500).moveTo(150, 300).release().perform() does not work scroll as intended

I am using Appium server 1.6.5 and java-client-5.0.0-BETA9 against my iPhone 6s running 10.3.3.

`IOSDriver driver = new IOSDriver(new URL(“http://0.0.0.0:4723/wd/hub”), capabilities);
Dimension size = driver.manage().window().getSize();
int starty = (int) (size.height * 0.60);
int endy = (int) (size.height * 0.80);
int startx = size.width / 2;

TouchAction action = new TouchAction(driver);
Log.info(“Scroll down”);
action.press(startx, endy).moveTo(startx, starty).release().perform();
`
The above code only refreshes the screen and works like a “drag”. Interchanging the starty and endy to the press and moveTo also behaves the same way. I want to be able to scroll down on my screen to find the element which is towards the middle/bottom.

Try:

new TouchAction(driver).press(startx , starty).waitAction(Duration.ofMillis(0)).moveTo(0, endy - starty ).release().perform();

I have duration set to 0 on iOS, because when filled it is triggering a long press on some elements instead.

Thanks! that did work but I had to make sure that endY- startY < 0 for the scroll down to work. The documentation should reflect this about direction of scroll

You control those values… if its <0 it will scroll the other way, no problem.

@Jai_P better use TouchAction gestures not working with Java client 5.0.0Beta on iOS