How to set Date in custom date picker

Hi ,

We have custom date picker whose class is “EditText” and ID as “numberpciker”. We tried SendKeys and swipe but it’s not working. Using Xpath I was able to use "gettext() for the same and got the value printed from date picker but not able to send or set values after that.

You need to get the index of the element first and then send text into it.

Eg: public void enterDataIntoPickerWheel(String xpathSelector, String text, int index) {
driver.findElements(By.xpath(xpathSelector)).get(index).sendKeys(text);
}

I am doing this but sendKeys() is not selecting a date. Is there an alternative solution for this?

what is the iOS version?

I am trying to do it on Android 9.0

get the index of the picker and send the value using send keys.else u can try to use another android like 7.0.
if still not works we can dig some more.provide logs, dom structure, or code snippet

You may be in a situation similar to mine. We are testing against a custom date picker written in HTML/CSS/JS… We cant use send keys either since the input is disabled. Instead, we have to simulate the user clicking/tapping through the date picker so our Selenium goes:
find xpath to open date picker -> click it -> find xpath for button to move backwards one month in the open date picker -> click it -> find xpath for the date we want -> click it

Its a pain but we were able to wrap that in a reusable method that accepts a date to find as a parameter.