Appium Android Java Date/Time Picker

497 views
Skip to first unread message

RedDevil

unread,
Jun 6, 2014, 8:00:19 PM6/6/14
to appium-...@googlegroups.com
Hi,
Is there a way/documentation in Appium to set data to the Date/Time Picker for ANDROID in Java. Can anyone give a good example for the same. Also is it possible to findElementById in Android?

bootstrap online

unread,
Jun 6, 2014, 8:02:34 PM6/6/14
to RedDevil, appium-...@googlegroups.com
On Fri, Jun 6, 2014 at 8:00 PM, RedDevil <min...@firespotter.com> wrote:
> Also is it possible to findElementById in Android?

Yes

> Is there a way/documentation in Appium to set data to the Date/Time Picker for ANDROID in Java.

If you can see the time picker via uiautomatorviewer then it should be
possible to automate.

RedDevil

unread,
Jun 6, 2014, 8:07:51 PM6/6/14
to appium-...@googlegroups.com, min...@firespotter.com
> Also is it possible to findElementById in Android? 

Yes.

How can this be done. I tried 

driver.findElement(By.id("app.package:id/elementId")) and it does not work.

> Is there a way/documentation in Appium to set data to the Date/Time Picker for ANDROID in Java. 

If you can see the time picker via uiautomatorviewer then it should be 
possible to automate. 

I see it via uiautomatorviewer but my question is how do I find the element and set data to it as Byid does not work? So is content_desc the only way or is there anything else?

bootstrap online

unread,
Jun 6, 2014, 8:19:08 PM6/6/14
to RedDevil, appium-...@googlegroups.com
On Fri, Jun 6, 2014 at 8:07 PM, RedDevil <min...@firespotter.com> wrote:
>> Also is it possible to findElementById in Android?
>
> Yes.
>
> How can this be done. I tried
>
> driver.findElement(By.id("app.package:id/elementId")) and it does not work.

You need Android API 18 or better.

>> Is there a way/documentation in Appium to set data to the Date/Time Picker
>> for ANDROID in Java.
>
> If you can see the time picker via uiautomatorviewer then it should be
> possible to automate.
>
> I see it via uiautomatorviewer but my question is how do I find the element
> and set data to it as Byid does not work? So is content_desc the only way or
> is there anything else?

You can find it by any supported locator strategy for the given API level.

>
>
> On Friday, June 6, 2014 5:02:34 PM UTC-7, bootstraponline wrote:
>>
>> On Fri, Jun 6, 2014 at 8:00 PM, RedDevil <min...@firespotter.com> wrote:
>> > Also is it possible to findElementById in Android?
>>
>> Yes
>>
>> > Is there a way/documentation in Appium to set data to the Date/Time
>> > Picker for ANDROID in Java.
>>
>> If you can see the time picker via uiautomatorviewer then it should be
>> possible to automate.
>
> --
> http://appium.io
> ---
> You received this message because you are subscribed to the Google Groups
> "Appium-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to appium-discus...@googlegroups.com.
> Visit this group at http://groups.google.com/group/appium-discuss.
> For more options, visit https://groups.google.com/d/optout.

RedDevil

unread,
Jun 12, 2014, 3:28:01 AM6/12/14
to appium-...@googlegroups.com
I have 

android:minSdkVersion="10" android:targetSdkVersion="19" in the app AndroidManifest.xml

And I have installed all the APIs till 19 from the SDK manager. Can you please help with what might be the issue?

Reply all
Reply to author
Forward
0 new messages