How to find element in XCUIElementTypeTable (Appium iOS java automation)

In my test case i create three members and after this i will check the list. How can i iterate through a table on IOS using Java?

I have start with this code:

        MobileElement table = driver.findElement (By.className ("XCUIElementTypeTable"));
        MobileElement cellTable=table.findElement(By.className("XCUIElementTypeCell"));
        List <MobileElement> texts = table.findElements (By.className ("XCUIElementTypeStaticText"));

but no idea how to find or identify the XCUIElementTypeStaticText.can someone help me pls.? many thanks

try:


        List<MobileElement> texts = driver.findElements(MobileBy.iOSClassChain("**/XCUIElementTypeCell/**/XCUIElementTypeStaticText[2]"));

thanks for answering. but how can i iterate over the list ? I can only check for the first item in the list

It will return list of all elements with text: dash, koko and test. Just iterate them to check values.

        List<WebElement> textElements = driver.findElements(MobileBy.iOSClassChain("**/XCUIElementTypeCell/**/XCUIElementTypeStaticText[2]"));
        for (WebElement el: textElements) {
            System.out.println(el.getText());
        }

// e.g. get first item text
System.out.println(textElements.get(0).getText());

When i try to itare over the list i get only the first element. I think i only have the first element.