Having code as below:
<XCUIElementTypeTable>
<XCUIElementTypeCell>
<XCUIElementTypeStaticText name="US$ 4.00 ∙ 5-10 min">
<XCUIElementTypeOther>
<XCUIElementTypeStaticText name="QA- Hint Images (many images)">
<XCUIElementTypeImage>
<XCUIElementTypeCell>
<XCUIElementTypeStaticText name="US$ 5.00 ∙ 55-10 min">
<XCUIElementTypeOther>
<XCUIElementTypeStaticText name="Test name">
<XCUIElementTypeImage>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeCell>
<XCUIElementTypeTabBar>
<XCUIElementTypeWindow>
<XCUIElementTypeWindow>
Used below classchain: “_/XCUIElementTypeTable/XCUIElementTypeCell[1]/XCUIElementTypeStaticText[3]" If you see first TypeCell element, there are only 2 child elements of type “XCUIElementTypeStaticText”. So when i run "_/XCUIElementTypeTable/XCUIElementTypeCell[1]/XCUIElementTypeStaticText[3]” it should give no element because there are only two elements, instead it gives third element which is part of 2nd TypeCell element. And if i use “**/XCUIElementTypeTable/XCUIElementTypeCell[1]/XCUIElementTypeStaticText” then it gives all descendant “XCUIElementTypeStaticText” element.It should give only two elements as XCUIElementTypeCell[1] parent element have only 2 XCUIElementTypeStaticText
Found in appium 1.8 and latest version also(I verify this issue on deskop/ Appium inspector.