In my app I have various containers/menus. In testing I want to check the elements contained, ensure that they are hat is expected.
So far I have come a long way using elementByAccessibilityId
. I can get the container using that method. But I need to collect its children. How?
The elements I am looking for have Xpath like: //XCUIElementTypeScrollView[@name="SidePanelScrollView"]/XCUIElementTypeOther[1]/XCUIElementTypeOther/XCUIElementTypeButton[3]
So I tried:
let children = await driver.elementsByXPath(
//XCUIElementTypeScrollView[@name=“SidePanelScrollView”]/XCUIElementTypeOther[1]/XCUIElementTypeOther/XCUIElementTypeButton);
This works. But to make this work I need to know the XPath. Is there a way I can do it by accessibility ID?