I have a date picker field where I want to set the dates (with a picker for Month, Day and Year with + and - for each field) but don't know how to do that in Robotium. I tried to use solo.setDatePicker(int, int, int, int), but the code complains that the setDatePicker is not a valid function for solo. Does anyone know how to do this? Thanks!
I found this question while searching how to do this myself, and I tried the method you've cited in your question and it worked like a charm.
Here's my little code snippet:
solo.clickOnText("Pick Date");
solo.setDatePicker(0, 2012, 2, 16);
solo.clickOnText("Set");
I'm guessing they added support to this method after you've tried it, I'm currently using Robotium 3.1 and it works really well. I simply click on the button that opens my DatePickerDialog, change the date and set it.
This also works for TimePickerDialog, just use .setTimePicker(0,10,0).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With