How to scroll down using coordinates with appium in java

I have a problem how to scroll down in app on Android device using Appium in Java. I created a helper method which help me to scroll down, but I got a conversely effect (scroll up). Which coordinates I should use to get a desired result? Maybe I should write a different method? I tried to use negative coordinates values, but the test failed.
Please, help me.

Helper method:

public static boolean clickMobileElementByCoordinates(int x, int y, AppiumDriver<MobileElement> driver) {
 TouchAction touchAction = new TouchAction(driver);
 touchAction.tap(PointOption.point(x, y)).perform();
 return true; }

Call helper method in test class:

private String testPlatform;
testPlatform = testConfig.getTestPlatform();
        if (testPlatform.equalsIgnoreCase("android")) {
            ElementsUtils.clickMobileElementByCoordinates(60, 2, driver);

1 Like

I resolved the problem using one of examples from the link. Thank you so much for help.