真实的设备模拟器VS:uiautomator不显示资源ID为应用程序 [英] real device Vs emulator : uiautomator does not show resource-id for the app

查看:598
本文介绍了真实的设备模拟器VS:uiautomator不显示资源ID为应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为我appium元素的id - 机器人自动化测试。当我使用真实的设备与UIAUTOMATOR,我得到的资源 - ID与元素像交互:

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");

然而,当我使用的仿真器与我UIAUTOMATOR,没有资源 - 对同一元素的id和我的脚本也不能根据我真正的设备ID与元素互动...任何帮助就如何要解决这个问题,或者为什么它的行为这样?

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?

推荐答案

我发现使用不同版本的Andr​​oid设备的答案 - 解释的是Android 4.3在uiautomatorviewer的ID组件。的Andr​​oid版本小于API级18将不能够与元件的资源标识交互。

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.

这篇关于真实的设备模拟器VS:uiautomator不显示资源ID为应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆