Cannot scroll, swipe, and, moveto, Touchaction,UIScrollable, in appium 1.18.1 and javaclient version 5.0.0 / 7.3.0

I used the script/code below, nothing worked at all,
Is there any suggestion for me so I can scroll or swipe whatever it is to scroll down,
I have tried all the ways nothing works, someone please help me

(this script/code failed)

new TouchAction(driver).press(492, 514).waitAction(Duration.ofMillis(3800)).moveTo(578, -1035).release().perform();
new TouchAction(driver).press(807, 1010).waitAction(Duration.ofMillis(957)).moveTo(682, 121).release().perform();
new TouchAction(driver).press(678, 1621).waitAction(Duration.ofMillis(1030)).moveTo(678, 1921).release().perform();
new TouchAction(driver).press(660, 1007).waitAction(Duration.ofMillis(957)).moveTo(660, 107).release().perform();
new TouchAction(driver).press(660, 1007).waitAction(Duration.ofMillis(856)).moveTo(660, 707).release().perform();
new TouchAction(driver).press(660, 1607).waitAction(Duration.ofMillis(773)).moveTo(660, 2057).release().perform();
new TouchAction(driver).press(660, 1607).waitAction(Duration.ofMillis(670)).moveTo(660, 1907).release().perform();
driver.context(“WEBVIEW_1”);
driver.findElement(By.linkText(“Hindi”)).click();

(this script/code failed)

MobileElement element = driver.findElement(MobileBy.AndroidUIAutomator(
“new UiScrollable(new UiSelector().resourceId(“com.android.vending:id/nested_parent_recycler_view”)).scrollIntoView(”
+ “new UiSelector().description(“Jaringan Sosial”))”));
System.out.println(element.getLocation());

(this script/code failed)

TouchAction action =new TouchAction((PerformsTouchActions) driver);
Dimension size =driver.manage().window().getSize();
int width=size.width;
int height=size.height;
int middleOfX=width/2;
int startYCoordinate= (int)(height*.7);
int endYCoordinate= (int)(height*.2);

    action.press(PointOption.point(middleOfX, startYCoordinate)) .waitAction(WaitOptions.waitOptions(Duration.ofSeconds(2)))
            .moveTo(PointOption.point(middleOfX, endYCoordinate)).release().perform();

(this script/code failed)

TouchActions actions = new TouchActions(driver);
actions.new.press(PointOption.point(207, 582)).moveTo(PointOption.point(8,
-360)).release().perform();

(this script/code failed)

Dimension size=driver.manage().window().getSize();
int width=(int)(size.width/2);
int startPoint=(int)(size.getHeight() * 0.70);
int endPoint=(int)(size.getHeight() * 0.20);
int duration=2000;
mobileDriver.swipe(width, startPoint, width, endPoint, duration);

Try these:

Using UiScrollable - Scroll down: Use with Try-catch block

driver.findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().description(\""+parentScrollViewId+"\")).scrollForward()"));

Using UiScrollable - Scroll Up:

driver.findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().description(\""+parentScrollViewId+"\")).scrollBackward()"));

Using TouchAction Class - Scroll Down:

	public void scrollDown(AppiumDriver<?> driver, int repeatTimes) {//Scroll down using TouchAction Class

	org.openqa.selenium.Dimension size = driver.manage().window().getSize();
	TouchAction action = new TouchAction(driver);
	int startX = size.width/2;
	int startY = (int) (size.height*0.8);
	int endY = (int) (size.width*0.2);

	for(int i=1;i<=repeatTimes;i++) {
		action.press(PointOption.point(startX, startY)).waitAction(WaitOptions.waitOptions(Duration.ofMillis(1000)))
		.moveTo(PointOption.point(startX, endY)).release().perform();
	}
}

example usage (parent ScrollView Id) I do not understand
i want to scroll down,neither method worked

It’s the resourceId or content-desc of the scrollView container which you want to perform scroll on.

For your case:

try{
driver.findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().resourceId("com.android.vending:id/nested_parent_recycler_view")).scrollForward()"));
}catch(Exception exception){
//ignore error
}

page 1

example
The first image is the start view of the PlayStore
and the second image is my scroll destination “Racing Games”
I use the script that you love, it still doesn’t work, there is an error in the script

page 2

i want to scroll to page 2

I just updated my code. Can you check now? The code block should wrapped inside try block.
Did you try all the solutions from here http://appium.io/docs/en/writing-running-appium/tutorial/swipe-tutorial/?


I tried your code but when I entered the red code resourceID

package com.tes.pusing;

import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.touch.TouchActions;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.net.MalformedURLException;
import java.net.URL;
import java.time.Duration;
import java.util.List;
import java.util.concurrent.TimeUnit;

import bsh.commands.dir;
import io.appium.java_client.MobileBy;
import io.appium.java_client.MobileElement;
import io.appium.java_client.PerformsTouchActions;
import io.appium.java_client.TouchAction;
import static org.junit.Assert.assertEquals;

public class tespusing {
WebDriver driver;

@Before
public void setup() throws MalformedURLException {

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("deviceaName", "VGWGZ58PVODA8TDI");
   
    capabilities.setCapability("platformName", "Android");
    capabilities.setCapability("platformVersion", "6.0");
    capabilities.setCapability("appPackage", "com.android.vending");
    capabilities.setCapability("appActivity", "com.android.vending.AssetBrowserActivity");
  
    driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);

}

@Test
public void tesTelkomsel() throws InterruptedException {

try{
driver.findElement(MobileBy.AndroidUIAutomator(“new UiScrollable(new UiSelector().resourceId(“com.android.vending:id/nested_parent_recycler_view”)).scrollForward()”));
}catch(Exception exception){
//ignore error
}

try{
driver.findElement(MobileBy.AndroidUIAutomator(“new UiScrollable(new UiSelector().resourceId(“com.android.vending:id/nested_parent_recycler_view”)).scrollForward()”));
}catch(Exception exception){
//ignore error
}

this is my full code
please help me as i am still a beginner

Can you please share the server log?