jeudi 22 mars 2018

Unable to scroll and select the elements in the date picker

Scenario-

Choose a date from the date picker-> Now click on the year object-> Scroll upto 2025 value to get as an year

The only problem is that- Unable to scroll in the year object for the desired value.

Line of code-

driver.findElementById("com.letsdogether.dogether:id/send_enquiry_date_text").click(); driver.findElement(By.xpath("//android.view.View[@index='21']")).sendKeys("22"); ------- Date selection driver.findElementById("com.letsdogether.dogether:id/date_picker_year").click();--------------- driver.findElementsByAndroidUIAutomator("new UiScrollable(new UiSelector()).scrollIntoView(text(\"2024\"));");------Scrolling

 driver.findElement(By.xpath("//android.widget.TextView[@index='1']")).sendKeys("2024");----- Year selection

driver.findElementById("com.letsdogether.dogether:id/ok").click();

Check these ss-> 2025 has same index and class as similar to 13TH (which is a date value not the year value)..

I think Due to which scrolling is not happening in the object year(which is desired need) . Any solution???enter image description here

Aucun commentaire:

Enregistrer un commentaire