Is there any way we can use starts-with or contains in Xpath for @AutomationId
can we use starts-with or contains in Xpath for @AutomationId, currently it works with @Name
valid example //Button[@AutomationId='this is the id' and contains(@Name, 'this the name')] //Button[contains(., 'this the name or the id')]
Invalid unless the robot has admin privilages for some apps (maybe). Otherwise it should also work fine //Button[contains(@AutomationId, 'thisistheid' )]
@noubar @Nepitwin
Thanks I am able to find the xpath with //Button[contains(., 'this the name or the id')].
Is there any we can loop through the elements, If more elements are found for the above condition.
I want to validate whether the first occurrence of the Id has specific parameters and second has different parameters.
Tried using //Button[contains(., 'this the name or the id')][2 or 3] it didn't work, it was able to find the first occurrence only.
Currently we support only first occurence. Which should be enough because usually in app (gui under test) side, if it is ui automation friendly. It should always support unique automationid or name for specific element. Thus the element will have an unique xpath which can not occure more than once.