Hi,
Yes, your approach could have impact on test performance and Ranorex search speed. If the xpath is too short/too generic, it will have to search through all elements in your app an so it could take some time to find the element, not to mention it could find the wrong one
I would consider using somewhat shorter xpath, from the original one, but still specific enough to help Ranorex to find the element faster, like this:
Code: Select all
/form[@title='AlarmActivity']/androidelement//container/button[@text='+']
Additionally, from my brief experience with Android, I found that even if there is very low number of useful attributes, Android elements often have some useful info in
platformclass attribute! So I would suggest to examine it in your app (via Spy) and eventually, change the xpath weight (as described
here) to prioritize the
platformclass attribute over other attributes. Then if your track/record an Android element, Ranorex should add platformclass to the xpath. Even after that, you may need to edit/shorten the xpath. But it could definitely make the xpath much more robust!