Android DatePicker

Mobile Testing, Android App Testing.
tgroeger
Posts: 13
Joined: Wed Oct 16, 2013 12:43 pm

Android DatePicker

Post by tgroeger » Wed Apr 23, 2014 2:06 pm

Hello everyone,

I've recently come across a particularly annoying problem. I have to automate setting a date using the android widget "DatePicker". As you can probably imagine I wish to circumvent the need to have to press arrows until the value I wish to set appears so I'm looking for a way to set the chosen date in a more direct manner.

Ideally I would be able to set the value of the widget and thereby force it to the date I wish to set, before closing it again. Unfortunately I haven't yet found a way to do that using the usual methods. I hope you can help me with that.

Regards, tgroeger

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Android DatePicker

Post by Support Team » Thu Apr 24, 2014 4:27 pm

Hi tgroeger,

You could use for instance the “Set Value”-action in your recording, but you have to add a “Touch”-action to the elements of the DatePicker. If you don’t add a “Touch”-action before the “Set Value”-action the value will not be saved into the elemtents.

Please have a look at my attached screenshots, to illustrate my workaround.
DatePicker.jpg
DatePicker.jpg (23.77 KiB) Viewed 1563 times
DatePicker (2).jpg
DatePicker (2).jpg (8.12 KiB) Viewed 1563 times
Please let me know, if this workaround fixed your problem.

Regards,
Markus (S)
.
Image

tgroeger
Posts: 13
Joined: Wed Oct 16, 2013 12:43 pm

Re: Android DatePicker

Post by tgroeger » Fri Apr 25, 2014 2:16 pm

Unfortunately even with those measures in place the value I entered was not saved. Even trying to use a swipe or touching various or single parts of the date before or after entering a value did not help.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Android DatePicker

Post by Support Team » Mon Apr 28, 2014 2:00 pm

Hi tgroeger,

Thank you for the response.
Unfortunately it is hard to analyze the problem without application.
May I ask you if it is possible for you to provide your application?

If you don’t want to post the application here in the forum, you can send it to [email protected].

This will help us to analyze the issue in detail.
Thank you in advance.

Regards,
Markus(S)
.
Image

tgroeger
Posts: 13
Joined: Wed Oct 16, 2013 12:43 pm

Re: Android DatePicker

Post by tgroeger » Tue Apr 29, 2014 10:28 am

Hello Markus,

just today I've gotten my hands on a newer android device, which is also running a newer version of android (4.2.2) than my previous device. In this version your workaround seems to work just fine with a few modifications.

Thanks for your help!

Regards, tgroeger