android uiautomator学习(二)主要类的简单介绍 .
2014-05-07 16:42
399 查看
从别处泊来的一片短文,对初学uiautomator的人非常有帮助
说明白了各个类的主要作用
可用UiDevice表示设备
getUiDevice().pressHome();
UiSelector表示一个搜索条件以获取一个特定的组件。
UiObject appItem = new UiObject(new UiSelector()
.className("android.widget.ListView").instance(1)
.childSelector(new UiSelector().text("Apps")));
UiObject 一个UI组件,一般和UiSelector连用
UiCollection一系列的UI组件
UiCollection videos = new UiCollection(new UiSelector()
.className("android.widget.FrameLayout"));
int count = videos.getChildCount(new UiSelector()
.className("android.widget.LinearLayout"));
UiScrollable代表一个可能需要滑动先用视图才会被用户看见的组件。
UiScrollable settingsItem = new UiScrollable(new UiSelector()
.className("android.widget.ListView"));
UiObject about = settingsItem.getChildByText(new UiSelector()
.className("android.widget.LinearLayout"), "About tablet");
about.click()
说明白了各个类的主要作用
可用UiDevice表示设备
getUiDevice().pressHome();
UiSelector表示一个搜索条件以获取一个特定的组件。
UiObject appItem = new UiObject(new UiSelector()
.className("android.widget.ListView").instance(1)
.childSelector(new UiSelector().text("Apps")));
UiObject 一个UI组件,一般和UiSelector连用
UiCollection一系列的UI组件
UiCollection videos = new UiCollection(new UiSelector()
.className("android.widget.FrameLayout"));
int count = videos.getChildCount(new UiSelector()
.className("android.widget.LinearLayout"));
UiScrollable代表一个可能需要滑动先用视图才会被用户看见的组件。
UiScrollable settingsItem = new UiScrollable(new UiSelector()
.className("android.widget.ListView"));
UiObject about = settingsItem.getChildByText(new UiSelector()
.className("android.widget.LinearLayout"), "About tablet");
about.click()
相关文章推荐
- 手把手教你uiautomator_android自动化测试第一个示例
- UIAutomator如何添加第三方jar包
- android自动测试方法分析(monkeyrunner,robotium,uiautomator)
- Android自动化测试(UiAutomator)简要介绍(原)
- UiAutomator输入中文,超详细步骤
- UIautomator运行步骤
- UIAutomator环境配置
- Appium基础认识
- uiautomator 编译运行步骤
- UiAutomator测试中如何恢复手机输入法
- UiAutomator提示不支持 diamond 运算符错误解决办法
- 利用UiAutomator写一个自动遍历渠道包关键功能的脚本
- android UiAutomator基本api的二次封装
- android UiAutomator写一个给微信朋友圈所有动态点赞的用例
- 自动化测试中递归函数的应用
- android UiAutomator定位失灵的一种解决办法
- android UiAutomator聊天室用例中断言的应用
- android UiAutomator添加收货地址的用例
- android UiAutomator写一个自动修改密码的case
- android UiAutomator写一个QQ小号给大号点赞的case