We are working on implementing automated testing for the iOS version of our app and have encountered some issues and differences between iOS and our Android counterparts. For instance, in one area of the app we are showing a modal and the hierarchy is completely different- on Android we are only able to interact with elements in the top most modal (which is ideal) and iOS hierarchy shows elements from screens that are not visible. Why are they so vastly different in this way? How do I ensure that automation is only interacting with the topmost elements- i.e. if there is more than one
closeButton in the hierarchy how can I ensure that I am tapping the correct one?
In addition, I am finding that android deals with item indexes but iOS does not- so if we had two inputs on the page and we are trying to the the text of the second input we do something like this for android
input and we can get the text of that element but on iOS it interprets this as the first letter and often returns a failure of being unable to find element
i- is there a way to use indexes on iOS?
It is our hope to run the tests on iOS that were made for our android app- is this not common practice?