Earlier my xpath for a certain image element was written with text containing English words.
Now, with vernacular support it has lengthened. Seeking help to shorten it.
XPath with English support:
//android.widget.TextView[contains(@text,'Web') and contains(@text,'Result')]/preceding-sibling::android.widget.ImageView[@index=0];
XPath supporting Tamil as well:
//android.widget.TextView[(contains(@text,'வெப்') or contains(@text,'Web')) and (contains(@text,'விளைவாக') or contains(@text,'Result') )]/preceding-sibling::android.widget.ImageView[@index=0];
Is there any way I can shorten the above Xpath ? Something like below (but not exactly using pipe):
//android.widget.TextView[contains(@text,'Web'|'வெப்') and contains(@text,'Result'|'விளைவாக')]/preceding-sibling::android.widget.ImageView[@index=0];
There is the XPath 2.0
matchesfunction e.g.matches(@text,'வெப்|Web').