Calendar DatePicker: Keeps scrolling up and down

this is not needed. also you can add ‘setAsVerticalList’ see example at → http://appium.io/docs/en/writing-running-appium/tutorial/swipe/android-layout-direction/

Hi Aleksei,
I tried to execute the script by removing .flingBackward(). Also I tried by adding .setAsverticalList() function.
In both cases, it doesnot scrolled till the desired value.

Thanks for your support

you do not say what happens. it is hard to suggest in such case.
is it scrolling to somevalue? what start value and where it stop?

Hi Aleksei,

I wanted to scroll from Current Year (2021) to previous Year: 1988 from Calendar App available API Demo App. When I used above mentioned methods, It will scroll up& down some 3-4 times & test will fail.
Currently im trying in Android device.

Thank you

Well. Nothing left. You need scroll manually and check that needed year appeared.
You may do this either with swipe by x,y or try ‘scrollBackward()’ with uiSelector.

hi ,
you got solution for these calendar issues.now im also facing the same issues…pls send your sample code its very useful for .this s my one task in my new firm.waiting for your reply …

hi,
same issues are faced.need your kind help send any sample code Aleksei…

Hi,

I am facing the issue for the selection of year. It is scrolling down not the up… I tried with flingBackward(), scrollBackward(), flingToBeginning(10)… Can any one help me

driver.findElement(By.xpath(“//android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[2]/android.widget.ImageView”)).click();
Thread.sleep(1000);

	driver.findElement(By.xpath("//android.widget.TextView[@resource-id=\"android:id/date_picker_header_year\"]")).click();
	driver.findElement(AppiumBy.androidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView"+ "(new UiSelector().textContains(\"1999\").instance(0)).scrollBackward(10)")).click();