How to scroll to the Particular date in Mobile Application using Appium 2.0

52 views Asked by At

I need some help in automating the date picker in appium 2.0 using java selenium.

I'm trying to scroll to the date January 23 2023 from the below image view.

date selector using scroll

I have tried with below code but it is not working.

try {
            String scrollableList="android:id/numberpicker_input";
            String elementClassName="android.widget.EditText";
            String anyText="January";

            
              driver.findElement(AppiumBy.androidUIAutomator(
              "new UiScrollable(new UiSelector().resourceId(\"" + scrollableList +
              "\")).getChildByText(" + "new UiSelector().className(\"" + elementClassName +
              "\"), \"" + anyText + "\")"));
             
        }catch (Exception e){
            System.out.println("Cannot scroll further");
        }

Onething I need to inform here is resource-id and className is same for day-month-year.

0

There are 0 answers