Calender Datapicker for date/month/year in appium

I have to select the desired date on theDatapicker but unable to do so.

  • What I did, made a function which will store all the web elements in a list and traverse through the desired input(date/yr/month) by their index values and perform an action on it.
  • In my case, I have only class & index value through which I would play with them.
  • This wouldn’t work for me.

Code:
MobileElement list = driver.findElement(loc);
try{
list.findElement(MobileBy
.AndroidUIAutomator(“new UiScrollable(new UiSelector()).scrollIntoView(”
+ “new UiSelector().text(” val “));”));}
catch(Exception e){
e.printStackTrace();
System.out.println(“Cannot scroll further”);

Also did that approach:
2. “new UiScrollable(new UiSelector().text(”.val")).flingForward()"));

Screenshot: