Hybrid App - Automating a date picker

2,553 views
Skip to first unread message

Tester

unread,
Apr 16, 2013, 8:20:10 PM4/16/13
to appium-...@googlegroups.com
Hi,
I am using Appium to automate my hybrid app on an iPhone simulator.
One of the pages in my app is a web view page but has a dob field which is of type 'date' and opens up the date picker.
I tried to enter date using sendKeys method of WebElement in web driver. But did not help.
Any help here?
Thanks

Jonathan Lipps

unread,
Apr 16, 2013, 8:22:38 PM4/16/13
to Tester, appium-...@googlegroups.com
You could try backing out of webview mode and finding the datepicker as a native element, setting it that way, then going back into webview mode.

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Tester

unread,
Apr 18, 2013, 4:37:05 PM4/18/13
to appium-...@googlegroups.com, Tester
Good idea!! I tried it, the date picker comes up but still the year is not getting set. This is my code.

    driver.findElements(By.tagName("textfield")).get(3).click();

    driver.findElements(By.tagName("picker")).get(0).findElements(By.tagName("pickerwheel")).get(2).sendKeys("1995");

    driver.findElement(By.name("Done")).click();


The above works for my collegue who launches appium through command line.

I launch appium through ide and the version i have is 1.5.5.
Should I try anything different?

Vikas Chaudhary

unread,
Jun 19, 2014, 6:24:07 PM6/19/14
to appium-...@googlegroups.com
Hi,

I am using Appium driver and when I am trying to select the datepicker with tagname, it says that [31morg.openqa.selenium.UnsupportedCommandException: Invalid locator strategy: tag name

Any help will be appreciated.

Thanks
Vikas

Isaac Murchie

unread,
Jun 20, 2014, 11:20:26 AM6/20/14
to Vikas Chaudhary, appium-...@googlegroups.com
The 'tag name' locator strategy is no longer available. Mostly you can do what was done using 'automation id'.


On Thu, Jun 19, 2014 at 3:24 PM, Vikas Chaudhary <vika...@gmail.com> wrote:
Hi,

I am using Appium driver and when I am trying to select the datepicker with tagname, it says that [31morg.openqa.selenium.UnsupportedCommandException: Invalid locator strategy: tag name

Any help will be appreciated.

Thanks
Vikas

On Tuesday, April 16, 2013 8:20:10 PM UTC-4, Mugil wrote:
Hi,
I am using Appium to automate my hybrid app on an iPhone simulator.
One of the pages in my app is a web view page but has a dob field which is of type 'date' and opens up the date picker.
I tried to enter date using sendKeys method of WebElement in web driver. But did not help.
Any help here?
Thanks

--
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.

Josh Kolber

unread,
Jun 23, 2014, 6:23:24 PM6/23/14
to appium-...@googlegroups.com
How would that call look like in python? I'm trying self.driver.find_element_by_accessibility_id('Date Picker Field').send_keys('May 23, 2014') to set the date in a UIApickerwheel date selector, but the picker doesn't take that as valid input.

Isaac Murchie

unread,
Jun 23, 2014, 6:33:33 PM6/23/14
to Josh Kolber, appium-...@googlegroups.com
Sorry, I meant accessibility id. Do you get the element?

Reply all
Reply to author
Forward
0 new messages