Page elements do not refresh after scrolling

I’m running my app on an Android device and trying to scroll down to a particular element in a list that is currently not visible and click it.
This issue I have encountered is that when I scroll on the app, the page elements do not refresh and so makes it impossible to click the now visible element.
Please see below the before and after views of scrolling
Before scroll

!

After scroll

!

I have tried the following:
AndroidElement el = driver.FindElement(MobileBy.AndroidUIAutomator(“new UiScrollable(new UiSelector()).scrollIntoView(resourceId(“change-password-link”));”));
// tap element
el.Click();

But I get the following error:
System.InvalidOperationException: no such element (An element could not be located on the page using the given search parameters (ANDROID_UIAUTOMATOR=‘new UiScrollable(new UiSelector()).scrollIntoView(resourceId(“change-password-link”));’)) .

Has anyone else encountered this problem and if so how did you overcome it?

  • Did you check the behaviour with appium desktop ? After scroll down, can Appium Desktop is able to view new element ?

  • After scroll add 1 or 2 sec wait till backend gives back new info, use charles to see what’s happening with backend once you scroll down

  • I would also suggest to try out arc to play with app in interactive mode

    read 10. Elements Locator Strategy >>> Method 2: ( Appium Ruby Console ) <<< in below blog

    https://vikramviknowledgesharing.wordpress.com/2017/01/01/appium-mobile-automation/

  • Also as a suggestion check out https://github.com/vikramvi/AppiumSerenityPOC which shows usage of Serenity BDD framework with Appium to invest time in automating new test case rather than maintaining framework.