Scrolling to element in android app using java


The following code works fine for me.

public WebElement scrollToAnElementByText(AppiumDriver<WebElement> driver, String text) {
        return driver.findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector())" +
                ".scrollIntoView(new UiSelector().text(\"" + text + "\"));"));


Thank you Anto_Rodrigo

This got worked for me.

I am searching for year from drop down, and it is present at the end of that drop down but its not visible whenever I open that drop down. So I used function that you have mentioned above and it got worked for me very well.


Sounds good :slight_smile: @Mayuresh92