Thanks. I tried to resolve it by using Java Script Executor and XCUI Test.
Thanks so much @mykola-mokhnach
Now i am trying to achieve the same in Android Native App. I am trying to automate the scenario, where there is a need to scroll vertically till a particular widget is visible. From there, i need to perform a horizontal scroll in the recycler view of the widget. I am really struck with this issue for more than 2 days.
Environment : Java Client 6, Appium Desktop 1.6
I somehow try to achieve the vertical scroll using UiScrollable and UiSelector Class by finding the element of widget header. But now, my horizontal is not able to scroll horizontal, since it default takes the first recycler view at the top of the screen. I want to scroll the second one. Unfortunately, there is no unique id for the recycler view and textview. Pls, help me out
Vertical Scroll Code Snippet:
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:
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();