Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with select date from the datepicker with Appium for Android Driver #91

Closed
niranjanparija opened this issue Feb 4, 2016 · 5 comments

Comments

@niranjanparija
Copy link

Hi,I am facing issues to select date from the datepicker with Appium for Android Driver.Please check the attached screenshots of the Calender I am looking for.

I have already tried with element.clear() followed by element.sendkeys("text"),but its not working.

Also I tried to work with Scroll to followed by TouchAction ,where its working till selecting the Year ,but after that its failed to select the date and month which should be selected from the screenshot named as DatePicker2.

Can anyone please suggest me any workout .
daypicker1
daypicker2
daypicker3

@niranjanparija
Copy link
Author

Can anyone please suggest on this ,how to tackle the issue.So far tried with all the possible options like DatePicker,Number Picker with Xpath,Class,SendKeys,Scroll To and unfortunately nothing works so far.

@niranjanparija
Copy link
Author

Facing the same issue with attached calender also.
2nd calender

@niranjanparija
Copy link
Author

@TikhomirovSergey - can you please guide on this issue

@rkavalap
Copy link

rkavalap commented Dec 6, 2016

Issue moved to appium/appium #7398 via ZenHub

@joshidipakkumar
Copy link

joshidipakkumar commented Jun 21, 2018

for all the user who are still finding the way to select date can use below code. I am using this code and working perfectly for me. It will work for 2nd screenshot attached by rkavalap.

do {      
WebElement source = driver.findElement(By.xpath("//android.view.View[@instance='0']"));    WebElement destination = driver.findElement(By.xpath("//android.view.View[@instance='22']"));       TouchAction action = new TouchAction((PerformsTouchActions)driver);    System.out.println("Dragging item");    action.longPress(source).moveTo(destination).release().perform();   

boolean bul = driver.findElementsByXPath("//android.view.View[@content-desc='24 January 2018']").isEmpty();

  } while(bul!=false);    

driver.findElementByAccessibilityId("24 January 2018").click();
androidcalendar

I used drag and drop touch action to scroll and this will scroll uptill given date is not found. I just selected same years previous month date. You can use same touch action to select desired year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants