Everytime i execute your code, its giving me some errors so I have to change it to for the errors to be resolved
public static void scrollTo(String direction, int times) throws InterruptedException {
Thread.sleep(1000);
Object down = null;
if (direction.equals(down)) {
org.openqa.selenium.Dimension dim = driver.manage().window().getSize();
int width = dim.getWidth() / 2;
for (int i = 0; i < times; i++) {
int startY = (int) (dim.getHeight() * 0.7);
int endY = (int) (dim.getHeight() * 0.5);
new TouchAction(driver).press(point(width, startY)).waitAction(waitOptions(Duration.ofSeconds(1)))
.moveTo(point(width, endY)).release().perform();{
}
}
}
}
private static WaitOptions waitOptions(Duration ofSeconds) {
// TODO Auto-generated method stub
return null;
}
private static PointOption point(int width, int startY) {
// TODO Auto-generated method stub
return null;
}
and im calling it by scrollTo(“down”, 1);
But its still not working. Can you please help me with this?