Android Date Picker

Asked by Peter Kim

Hi.
I would like to create a Sikuli function that select a given date using Android DatePicker widget.

The widget looks somewhat like
http://a1.phobos.apple.com/us/r1000/027/Purple/30/8e/0c/mzl.tonfmtjw.480x480-75.jpg
although the image is from Apple.

The DatePicker widget I am working with has date in YYYY MM DD format.
The widget displays today's date highlighted in the center and two previous dates above and two following dates below.

To set the year to 1960, I would first click 2010 and then the same location 50 times until 1960 appears.
I will do similar things to get the wanted month and date.

I know how to locate the right position to click and click the position so many times.

But then how do I know that the date I finally selected is the right date?
What is the best way to find out if the highlighted date is the correct date?

Also is there a better way to get to the date I want?

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Peter Kim
Solved:
Last query:
Last reply:
Revision history for this message
Peter Kim (pd-kim) said :
#1

I was able to set dates to the dates I wanted by calculating the positions to start clicking and the number of times to click to get to the date I wanted. I used text() to get the date displayed on the title bar. I tried to use it to get the date highlighted but it did not work as well.

I had many dates to try and it took quite a long time to complete all of them.

I wonder how an Android/Java programmer would test the Date Picker widget.