How can i scroll till button enabled true

My question is simple, how can I scroll until a button is active? You can think of a contract screen. When you scroll to the bottom line, the “agree” button becomes active.

When i use MobileElement element = appiumDriver.findElement(MobileBy.AndroidUIAutomator(“new UiScrollable(new UiSelector().scrollable(true))” +
“.scrollIntoView(new UiSelector().text(“ABC”))”));
}

MobileElement el5 = appiumDriver.findElementById(“com.abc.abcd:id/tvOkBtn”);
el5.click();

The word abc is the last word in the contract.
This way, it goes down to the last line, but does not go to the click button command.

COMMAND PARAMETERS

{ “using”: “-android uiautomator”, “value”: “new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().text(“ABC”))” }

error: COMMAND RESULT
{“message”:“An element could not be located on the page using the given search parameters.”}

i solved my problem with this :slight_smile:

    try {
        appiumDriver.findElement(MobileBy.AndroidUIAutomator(
                "new UiScrollable(new UiSelector().scrollable(true)).flingToEnd(15)"));
    } catch (InvalidSelectorException e) {
        // ignore
    }