android uiautomator学习(二)主要类的简单介绍
2013-03-14 17:17
471 查看
从别处泊来的一片短文,对初学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()
相关文章推荐
- android uiautomator学习(二)主要类的简单介绍 .
- android uiautomator学习(二)主要类的简单介绍
- 鼓捣RxAndroid--介绍 学习响应式编程的简单方法
- Android学习之四大组件简单介绍
- Android学习之介绍Binder的简单使用
- Android Studio IDE 简单学习和介绍
- Android自动化学习笔记之MonkeyRunner:官方介绍和简单实例
- Android自动化测试(UiAutomator)介绍与学习
- androidpn学习 (一) androidpn server简单介绍
- android uiautomator学习(二)主要类的功能简单介绍
- android 学习笔记1-介绍 环境 简单布局
- Android学习之界面篇(一)Android Animation简单介绍
- Android自动化学习笔记之MonkeyRunner:官方介绍和简单实例
- Android Activity四种启动模式简单介绍,学习记录。
- spring源码学习(1)-bean包中主要接口部分的简单介绍
- Android学习 - shell命令(简单介绍)
- (Android学习)LoaderManager.LoaderCallbacks<D>简单介绍
- 《第一行代码》第二版 学习总结16 Android权限简单介绍
- Android Design Support Library 中控件的使用简单介绍(一)介绍 在这个 Lib 中主要包含了 8 个新的 material design 组件!最低支持 Android
- Android学习历程3-倒计时类的简单介绍