Can't find nested elements with XCUITest [SOLVED]

Hi,

I’ve noticed that sometimes XCUITest’s findElement(…).findElement(…) doesn’t work.

Anyone else noticed it?

No logs attached because it sends the usual NoSuchElementException.

Edit:

I just succeeded finding the nested element in a very strange way. I hope someone could

explain this.

it goes like this:

String textA = ((IOSElement) driver.findElement(By.id(“PARENT”)).findElement(By.id(“NESTED”)))

String textB = ((IOSElement) driver.findElements(By.id(“PARENT”)).get(0).findElement(By.id(“NESTED”)))

textA isn’t found, while textB is found.

Edit#2:

SOLVED.

Is the id of ‘PARENT’ not unique? This would cause the above case.