real device Vs emulator : uiautomator does not show resource-id for the app

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 10:47:48

问题


I need the element id for my appium - android automation testing. When I use real device with UIAUTOMATOR, I get the resource - id to interact with the element like :

driver.findElementById("com.xyz.android:id/GSG");

However, when I use an emulator with my UIAUTOMATOR , there is no resource - id for the same elements and my script is also not able to interact with the element based on my real device id...any help as to how to fix this or why it behaves like this?


回答1:


I found the answer using different versions of android devices - the explanation is android 4.3 has the id component in uiautomatorviewer. Android versions less than API level 18 will not be able to interact with the resource-id of the element.



来源:https://stackoverflow.com/questions/21399503/real-device-vs-emulator-uiautomator-does-not-show-resource-id-for-the-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!