How to send year, month and day to Android date picker

Hi, has anybody figured out an easy way to send a year, month and day to the following Android date picker please?




You need to tap on year first, select it, then tap on the arrows of the month until you have the desired month and then pick a day, tap ok to close the overlay.
Please double check the xpath and id declaration I was in a hurry here and might missed something, but you get the logic.

public void selectDate() {
//here you may need to scroll a bit after the desired year
	        driver.finelementByXpath(android.view.View[@text = '1990']");
		driver.findelementByXpath(android.view.View[@text = '9']");
                driver.findelementByXpath(android.widget.Button[@text = 'OK']");
1 Like

Thanks Zuzeac. I’ll see if I can get it to work.