Situation: Appium Inspector is grouping all elements into 1 element on iOS. However, on Android, there is no issue given it is the same react-native build, and I am using real device for automation testing.
I have done my own research about why it will be like this, and I found the issue comes down to how the react-native app is written in code level. Most point to the “accessibility id” or “accessibility label”.
Also, there is a limitation that I have no access to the source code of the app, so I can only provide rather specific idea to app. team for changing the code to make it feasible in automation on iOS.
Question (1): I would like to ask is there any tips or insights about how to change the app. code specifically? Some posts mention about accessibility label or accessibility id, but how it should be changed, is there any reference reading or few line of codes that can facilitate the explanation to the app. team about how to change the code so that the automation can work on iOS?
Question (2): There may be difficulties about pushing the app. team to conduct the code change. Assuming that they don’t want to change the code, what is the workaround for capturing the label, text, name etc. of the elements that cannot be located properly with such situation on iOS?
My thought is first we need to capture the screenshot of the app’s UI that include the elements which cannot be located and captured its attributes, and then we can use the OCR technique to capture the word in the screenshots. It sounds possible and of course it is rather time-consuming if the issue can be easily solved by just changing the app. code…
For this worst scenario, what library or tool I should use that is integrated with Appium
My programming language is Python.
Finally, attached are the screenshots of both as an iOS and Android example for your reference:
Thank you for your time !!!
iOS example (indicated the issue):
Android example (it is working fine):