【uiautomator】Uiautomator API

Uiautomator API 

Uiautomator API被绑定在automator.jar文件中,automator.jar文件在<android-sdk>/platforms/dandroid-X(X≥16)目录下,API包括了主要的classes,interface和exceptions,这些帮助你捕获和处理目标APP的UI组件。 

 

Classes类

com.android.uiautomator.core.UiCollection

用来枚举界面容器的界面元素,用来统计子元素数量,是文本、描述定位子元素 

com.android.uiautomator.core.UiDevice

对外提供访问设备状态信息的方法,能模拟用户在设备上的操作:方向键、Home键、菜单键等 

com.android.uiautomator.core.UiObject

代表界面元素 

com.android.uiautomator.core.UiScrollable

提供支持查询在可滑动的界面容器中的界面元素 

com.android.uiautomator.core.UiSelector

可在设备上查询到一个或者更多的UI元素

 

 

Interfaces接口

com.android.uiautomator.core.UiWatcher

代表目标设备上的条件监听器 

com.android.uiautomator.testrunner.IAutomationSupport

给测试用例提供辅助支持 

com.android.uiautomator.testrunner.UiAutomatorTestCase

定义一个运行多个测试运行环境,所有的uiautomator测试用例必须继承这个接口

 

Exceptions异常

com.android.uiautomator.core.UiObjectNotFoundException

当UiSelector无法匹配带任何UI元素时抛出异常

posted on 2015-06-15 17:06  wonderful0714  阅读(628)  评论(0)    收藏  举报

导航