Search code examples
appium-android

findElementByAndroidUIAutomator scrollIntoView


I need to know how to scroll to an element that is not in view and does not have a Text attribute.
For elements with a text attribute I can successfully use:

driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector()).scrollIntoView(text(\"Documents\"));

But what is the best method when text is not available?


Solution

  • The best approach to scroll to an element into view is to swipe on the screen until the element is displayed.

    If incase you don't know how to swipe in Appium then see here how to do it.