How to click on calendar using IOS Cloud devices?

Hi. I have a doubt about xpath and IOS. In this app I’m using (TED) during the register flow the user has to click on a calendar field and pick his birthday date. As this flow follows invalid register data, I want to put birthday date of 05/02/2020. On android I did this:
driver.findElement(By.xpath("//[@id=‘dobView’]")).click();
driver.findElement(By.xpath("//
[@text=‘2018’]")).click();
driver.findElement(By.xpath("//[@text=‘2020’]")).click();
driver.findElement(By.xpath("//
[@text=‘OK’]")).click();
On IOS the placeholder is: driver.findElement(By.xpath("//*[@placeholder='Data de Nascimento (dd/mm/aaaa)']")).click();
But even using this command the app doesn’t find the placeholder and doesn’t click to open the calendar. Is there another way to find this field and click on it?

Hi Lucas,

I would suggest to try with a different identification instead of @placeholder just to see how that works out, if there is an @id or @name.

If that doesn’t work, try this:

If you are inside an App:

driver.context("NATIVE_APP");
driver.findElement(By.xpath("YOUR_XPATH")).click();

If you are in a Web Page:

driver.context("WEBVIEW_1");
driver.findElement(By.xpath("YOUR_XPATH")).click();
1 Like