Search code examples
c#androidappium

How to ScrollTo after ScrollTo and ScrollToExact were deprecated


I have noticed that the ScrollTo was deprecated, but didn't find any good solution to scrollTo any webelement on page.

Question:

can someone please help me figure out what's the best way to do that now in C#(Android device)?


Solution

  • yes your right ScrollTo after ScrollTo and ScrollToExact were deprecated, Please find the alternative solution here,

    MobileElement radioGroup = (MobileElement) wd
                    .findElementByAndroidUIAutomator("new UiScrollable(new UiSelector()"
                            + ".resourceId(\"<your listview or any scrollview id>\")).scrollIntoView("
                            + "new UiSelector().text(\"+<your text>+\"));");
            radioGroup.click();
    

    For more information please check this video: https://www.youtube.com/watch?v=bT3tqaLNn-Y