Scroll RecyclerView with loop

Problem: Inside RecyclerView there were a lot of Relative layouts so how can I make scrolling up?

MobileElement element = (MobileElement) driver.findElement(MobileBy.AndroidUIAutomator(
        "new UiScrollable(new UiSelector().scrollable(true).instance(0))" +
         ".scrollIntoView(new UiSelector().text(\"exact_text\"))"));

There is no exact texttext(“exact_text”) at relative layout and image appear random. How can I try? please give me any solution!!

not clear what problem? it does not start scrolling with your code example?
read also - many other ways.

How to scroll recycler view (inside recycler view >> too many relative layouts)

scrollIntoView(new UiSelector().text(\"exact_text\"))"));
I can’t find with exact text because Ads listing image appear randomly.

Here my code but it doesn’t work :disappointed_relieved:

// driver.findElement(MobileBy.AndroidUIAutomator(“new UiScrollable(new UiSelector().resourceIdMatches(”.*").scrollable(true)).flingToEnd(10)"));

	//driver.findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true))" + ".scrollIntoView(new UiSelector().resourceIdMatches(\".*\"))"));
	//driver.findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().resourceIdMatches(\"\").scrollable(true)).scrollForward(3)"));

nothing works with UiScrollable -> switch swipe by x,y

1 Like