# Able to scroll in date picker using scrollable class but it is not holding up on the text value which is passed in the method

**URL:** <https://discuss.appium.io/t/able-to-scroll-in-date-picker-using-scrollable-class-but-it-is-not-holding-up-on-the-text-value-which-is-passed-in-the-method/40153>\
**Category:** Support\
**Created:** [September 1, 2023, 6:08am UTC](https://discuss.appium.io/t/able-to-scroll-in-date-picker-using-scrollable-class-but-it-is-not-holding-up-on-the-text-value-which-is-passed-in-the-method/40153 "2023-09-01T06:08:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Demo\_User](https://discuss.appium.io/user_avatar/discuss.appium.io/demo_user/32/9993_2.png) [@Demo\_User](https://discuss.appium.io/u/Demo_User)\
**Post date:** [September 1, 2023, 6:08am UTC](https://discuss.appium.io/t/able-to-scroll-in-date-picker-using-scrollable-class-but-it-is-not-holding-up-on-the-text-value-which-is-passed-in-the-method/40153/1 "2023-09-01T06:08:44Z")

</div>

![Problem](https://discuss.appium.io/uploads/default/original/2X/a/ab46c14d4c4273f3fb431cf7e34d93d6547eec4f.png)

Able to scroll in date picker using scrollable class but it is not holding up on the text value which is passed in the method… Using this code

```
		List<WebElement> dates = driver.findElements(
				AppiumBy.androidUIAutomator("new UiSelector().resourceId(\"android:id/numberpicker_input\")"));
		System.out.println(dates);

		WebElement year = dates.get(2);
		year.findElement(AppiumBy.androidUIAutomator(
				"new UiScrollable(new UiSelector().scrollable(true).instance(2)).scrollIntoView(new UiSelector().text(\"2021\"))"));

		WebElement month = dates.get(1);
		month.findElement(AppiumBy.androidUIAutomator(
				"new UiScrollable(new UiSelector().scrollable(true).instance(1)).scrollIntoView(new UiSelector().text(\"June\"))"));

		WebElement date = dates.get(0);
		date.findElement(AppiumBy.androidUIAutomator(
				"new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().text(\"21\"))"));

```

@Aleksei

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [September 2, 2023, 6:48am UTC](https://discuss.appium.io/t/able-to-scroll-in-date-picker-using-scrollable-class-but-it-is-not-holding-up-on-the-text-value-which-is-passed-in-the-method/40153/2 "2023-09-02T06:48:26Z")

</div>

Sometimes scroll does not work with such pickers on Android. I use tap above/below and check value way.

E.g. with date tap above “1” switches value to 31, tap “2” switches value to 2.

See on on your screenshot there are buttons in each number picker -\>

 ![image](https://discuss.appium.io/uploads/default/original/2X/8/822e460f13c9e67a154b281a7bf6e100651180c9.png)

---

<div class="post-metadata">

**Author:** ![mykola-mokhnach](https://discuss.appium.io/user_avatar/discuss.appium.io/mykola-mokhnach/32/4578_2.png) [@mykola-mokhnach](https://discuss.appium.io/u/mykola-mokhnach)\
**Post date:** [September 2, 2023, 8:16am UTC](https://discuss.appium.io/t/able-to-scroll-in-date-picker-using-scrollable-class-but-it-is-not-holding-up-on-the-text-value-which-is-passed-in-the-method/40153/3 "2023-09-02T08:16:57Z")

</div>

I once had to do that in Python. Got the below code as a result. Probably not the fastest one, although reliable.

```python
        current_year_text = year_wheel.find_element(AppiumBy.CLASS_NAME, TEXT_CLASS_NAME_BIRTHDAY_VALUE)
        button_year_dec, button_year_inc = tuple(
            year_wheel.find_elements(AppiumBy.CLASS_NAME, BUTTON_CLASS_NAME_BIRTHDAY_VALUE_CHANGE)
        )
        while True:
            current_year = int(current_year_text.text)
            if current_year == bdate.year:
                break
            if current_year > bdate.year:
                button_year_dec.click()
            else:
                button_year_inc.click()

```

---

<div class="post-metadata">

**Author:** ![Demo\_User](https://discuss.appium.io/user_avatar/discuss.appium.io/demo_user/32/9993_2.png) [@Demo\_User](https://discuss.appium.io/u/Demo_User)\
**Post date:** [September 4, 2023, 6:04am UTC](https://discuss.appium.io/t/able-to-scroll-in-date-picker-using-scrollable-class-but-it-is-not-holding-up-on-the-text-value-which-is-passed-in-the-method/40153/4 "2023-09-04T06:04:32Z")

</div>

@Aleksei can you provide some example because not able to find any related example to tap method for latest appium version.

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [September 4, 2023, 7:32am UTC](https://discuss.appium.io/t/able-to-scroll-in-date-picker-using-scrollable-class-but-it-is-not-holding-up-on-the-text-value-which-is-passed-in-the-method/40153/5 "2023-09-04T07:32:38Z")

</div>

> [@Unable to use clickGesture](https://discuss.appium.io/t/unable-to-use-clickgesture/36180/6):
>
> it is quite obvious… Rectangle rectangle = ((WebElement) el).getRect(); Point point = new Point(rectangle.x + (rectangle.width / 2), rectangle.y + (rectangle.height / 2)); PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger"); Sequence seq = new Sequence(finger, 1); seq.addAction(finger.createPointerMove(Duration.ofMillis(0), PointerInput.Origin.viewport(), point.x, point.y)); seq.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg())); seq.addAction(finge…
