It’s one of the Frequently Asked Questions. Similar question and answer here:
It’s about WebUI testing, not about desktop app testing. I don’t know if the similar level of XPath (predicates using [position()=N]) is supported for desktop applications.