Typically when we work with selenium automation of a website, we go with say an element id, which is intuitive, human readable and via a process can be locked down to be shared between developers and automation engineers.
Our current assignment is automation of an Android app (hybrid app using Ionic) with Appium (running on web driver context, not native context).
Things are different here since Ionic generates the HTML on its own from the code and disregards the element ids given by the developers.
So we are left with the only option of using xpath which looks like:
//UIAApplication/UIAWindow/UIAScrollView/UIAWebView/UIAButton or //html/body/div/div/div/div/div/div/div/div/div/div
(note not written by developers, generated by Ionic).
This makes us uncomfortable for 2 reasons:
Not intuitive like before since we did not write it
Do not have clarity what changes by developers will cause a change in the xpath and break the automation test cases (basically need a system to prevent automation scripts from regressing because of developer code changes).
This brings me to 2 questions:
Is there a better option possible for identifying UI elements in a hybrid app than this
If not, is their an explanation for the two concerns posted above.
Any help will be much appreciated