Unable to scroll and select the elements in the date picker


Choose a date from the date picker-> Now click on the year object-> Scroll upto 2025 value to get as an year

The only problem is that- Unable to scroll in the year object for the desired value.

Line of code-

driver.findElement(By.xpath("//android.view.View[@index=‘21’]")).sendKeys(“22”); ------- Date selection
driver.findElementsByAndroidUIAutomator(“new UiScrollable(new UiSelector()).scrollIntoView(text(“2024”));”);------Scrolling

 driver.findElement(By.xpath("//android.widget.TextView[@index='1']")).sendKeys("2024");----- Year selection


Check these ss-> 2025 has same index and class as similar to 13TH (which is a date value not the year value)…

I think Due to which scrolling is not happening in the object year(which is desired need) . Any solution???