Scroll and click - Does not work for Android and iOS on the Appium tool with selenium java


I am trying to scroll and its not working for both Android and iOS, Can you please help me on this.

Look forward to hear back from you.

Did try with ScrollTO and ScrollToExact as both of them are deprecated now, so did try with this:

        String str = "CADILLAC";
        driver.findElementByAndroidUIAutomator("new UiScrollable(new  UiSelector().scrollable(true).instance(0)).scrollIntoView(new  UiSelector().textContains(\""+str+"\").instance(0))").click();

Still does not work.

Did go through many blogs , videos , course content and material no one has explained or there a specific solution on how to handle this

Did try with below,still gets the error


driver.findElementByAndroidUIAutomator("UiSelector().resourceId(\"current_value_tv\").text(\"All Makes\")").click();
driver.findElementByAndroidUIAutomator("UiSelector().className(\"android.widget.TextView\").text(\"AUSTIN HEALEY\")").click();

org.openqa.selenium.WebDriverException: An unknown server-side error
occurred while processing the command. (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 45 milliseconds Build info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35' System info: host: 'NCA1026471', ip: '', 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_91' Driver info: Capabilities [{app=C:\Appium\workspace\Lokesh\app\app-release.apk,, rotatable=true, networkConnectionEnabled=true, noReset=true, warnings={}, handlesAlerts=true, deviceName=Carsguide Product, version=0.17.0, platform=ANDROID,, desired= {app=C:\Appium\workspace\Lokesh\app\app-release.apk,,, noReset=true, platformVersion=5.0, browserName=, platformName=Android, deviceName=Carsguide Product, device=Android}, acceptSslCerts=true, platformVersion=21, automationName=selendroid, browserName=selendroid, takesScreenshot=true, javascriptEnabled=true, platformName=android, device=Android}] Session ID: e90cac4d-38aa-99fd-2dd2-70cc09a0e717 *** Element info: {Using=-android uiautomator, value=UiSelector().resourceId("current_value_tv").text("All Makes")} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

you can try this below code, i was trying this code on settings page..

AppiumDriver driver = new AndroidDriver(new URL(""), cap1);

driver.scrollTo("About phone");

Pass the String which is present in the bottom of your app page.

driver.scrollTo("Enter your value");

Use appropriate wait Statements.