Test Step1:
Perform a Vertical Scroll, till the targeted widget header is visible in the screen
Test Step2:
Perform a horizontal scroll in the recyclerview inside the widget, where the widget appears as second recycler view in the screen
Note: There is no unique id for recyclerview and textview. Really stuck with this issue for more than 2 days
Environment : I am try to automate the Music Android Native App using Appium Desktop 1.6.2,JavaCLient6 and Android 7.1.1
Vertical Scroll Code Snippet:(works fine, using UiScrollable and UiSelector)
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:(the code below, scrolls only the first recycler view, which i wanted to scroll the second recycler view)
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();