2

Android 的 uiautomator 中的 uiselector 类使用类名、文本、索引和其他属性来标识对象。是否可以扩展 uiselector 类以将对象的 id 用作选择器?如果没有,有什么方法可以获取显示对象的 id 吗?

4

2 回答 2

0

对于 API 级别 17 及以下,您将无法使用 id 检索对象。

从 API 级别 18 开始,uiautomator 为您提供了使用 ID 的选项。 http://developer.android.com/tools/help/uiautomator/UiSelector.html#resourceId(java.lang.String)

于 2013-12-06T18:27:36.753 回答
0

不。无法使用对象 ID 作为选择器(除非您重新编译 UiAutomator 工具)

于 2013-10-14T04:21:36.750 回答