Cannot compute child count in ListView, RecyclerView or any other scrollable view in Android with Appium

Yeah, that’s why I added the note about the scope of the app that I’m testing. For our app, I think the max number of times that I ever have to swipe in either direction (or sideways) to get where I want to go is five. Unfortunately, I haven’t really looked into a solution for longer lists.

As said above you might want to look at it from an API point of view. If you want to really do a functional test via UI, then how a normal user finds the item on the bottom of the list? It takes “ages” for him also?

there is a big difference in duration between user’s swipe / scroll gesture to the TouchAction operation and all the calculations you do before

Hello,

_**

I am really find it very diifcult to scroll the particular recyclerview horizontal scroll after achieving the vertical scroll using label. I am automating android native music app, the recyclerview or the widget or textview doesnt have unique id … to make the driver to scroll the second recycler view appearing the screen. Can anyone pls help me in this case.

**_

I am using appium desktop 1.6 and java client 6 .

Vertical Scroll Code Snippet(works fine, but there is exception always throwing … but managed)

driver.findElement(MobileBy.AndroidUIAutomator(“new UiScrollable(new UiSelector().scrollable(true).className("android.widget.LinearLayout")).scrollIntoView(new UiSelector().resourceId("com.touchtunes.android:id/home_widget_header").text("HOT AT MONTREAL RECEPTION ANGELINA"))”));

Horizontal Scroll Code Snippet(This scrolll only the first recycler view appearing in the screen, but the recycler which i want to scroll, appears as Second Recycler in the screen)
driver.findElement(MobileBy.AndroidUIAutomator(“new UiScrollable(new UiSelector().scrollable(true).className("android.support.v7.widget.RecyclerView")).setAsHorizontalList().scrollIntoView(new UiSelector().resourceId("com.touchtunes.android:id/item_hot_songs_song").text("Hotline Bling"))”)).click();

1 Like

Vertical and Horizontal scroll are working by using the above code.
Thanks for the solution.