Looking for particular string on screen with partial text for iOS native app

I am looking for particular string on screen with partial text using xpath,I need a way by which it will search anywhere in screen and not in specific control by avoiding xpath if possible,here is code I am using

$driver.find_elements(:xpath, ‘//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[1][contains(@value,“city”)]’)

Some good solutions in this thread:

1 Like

wreed thank you for pointing toward the link but none of the solution worked for me

any other suggestion?

Could you give some feedback on what you’ve tried and your results? Could you be dealing with a bad Xpath or other strategy? That link covers the partial string search very well, so maybe there is some other issue?