How to Scroll the device using Appium

i couldn’t scroll the mobile device using Appium.
i am getting the error message like --The method Scroll is undefined type of Android Driver.

Please solve my issues.

Please post you code too.

Anyways, if you are using ScrollTo() to ScrollToExact(), then these methods has been deprecated.

if ScrollTo() is deprecated that how do scroll the page in mobile devices using appium . please give the sample code for scroll the page.

What I have implemented is, count the height of the screen and use swipe to find the Element.

public void scrollTo(AndroidDriver androidDriver, String scrollToElement) {
	while(androidDriver.findElements(By.name(scrollToElement)).size()==0)
	{
		Dimension dimensions = androidDriver.manage().window().getSize();
		Double screenHeightStart = dimensions.getHeight() * 0.5;
		int scrollStart = screenHeightStart.intValue();
		Double screenHeightEnd = dimensions.getHeight() * 0.2;
		int scrollEnd = screenHeightEnd.intValue();
		androidDriver.swipe(0,scrollStart,0,scrollEnd,2000);
	}
	if(androidDriver.findElements(By.name(scrollToElement)).size()>0)
	{
		androidDriver.findElement(By.name(scrollToElement)).click();
	} 
	
}

You can use
TouchAction ta=new TouchAction();
ta.press.moveto(x,y).perform();
“don’t Forget perform”
Explore touch action method you will find many more methods