Android自动化大讲堂36--UIAutomator测试项目创建
来源:互联网 发布:广联达计价软件下载 编辑:程序博客网 时间:2024/05/20 19:16
终极自动化框架UIAutomator使用详解
本文节选自《深入理解Android自动化测试》第五章 5.4节
要创建UIAutomator测试项目,按照官网推荐的步骤是这样的:
将待测应用安装到设备中
识别应用UI组件(UI components):UI组件应包含文本标签(text labels)或描述标签(tandroid:contentDescription),或两者兼有。
确保该应用可访问:
1)对于ImageButton, ImageView, CheckBox等控件需要包含控件描述属性,即android:contentDescription(巴哥奔:这对于UIAutomator自动化脚本的稳定性和移植性非常重要);
2)对于EditText等控件需要包含提示文本属性,即android:hint(巴哥奔:编辑框的提示文本对于抓取该控件至关重要);
3)对于控件的图标最好关联android:hint(巴哥奔:原理同上);
4)确保用户界面上所有元素的定向控制器(directional controller),如轨迹球、D-pad等,均可正常使用;
5)通过UIAutomatorviewer工具确保UI组件支持测试框架(巴哥奔:这里指UIAutomator测试框架)。
配置测试环境:即引入UIAutomator测试包,具体步骤如下:
1)创建测试项目,这里咱们继续沿用HelloBugbenTest这个测试项目;
2)右键点击测试项目HelloBugbenTest选择“Properties > Java Build Path”:
3)点击“Add Library > JUnit then select JUnit3”添加JUnit框架;
4点击“Add External JARs… ”并导航到Android SDK目录选择platforms目录下面的 android.jar和UIAutomator.jar两个文件,如图5-6所示。
图5-6 导入android.jar和UIAutomator.jar
更多内容,请点击“阅读原文”
参考《深入理解Android自动化测试》一书,谢谢!
- Android自动化大讲堂36--UIAutomator测试项目创建
- Android自动化大讲堂35--UIAutomator控件捕获
- Android自动化大讲堂32--Instrumentation对项目的自动化测试
- android uiautomator自动化测试
- UiAutomator android自动化测试
- Android-自动化测试UIAutomator
- Android自动化测试uiautomator
- Android UiAutoMator自动化测试
- Android Uiautomator 自动化测试
- Android Uiautomator 自动化测试
- Android自动化大讲堂34--终极自动化框架UIAutomator使用详解
- uiAutoMator 自动化测试创建步骤
- Android自动化测试之UIAutomator
- Android自动化测试(UiAutomator)
- Android自动化测试工具uiautomator
- Python + Android + Uiautomator自动化测试
- Android自动化测试之UIAutomator
- Python + Android + Uiautomator自动化测试
- 10个帅酷的HTML5最新动画应用
- 乐视网改名新乐视;酷骑单车创始人否认解散团队;日本称今年捕杀177头鲸为研究丨价值早报
- 图论
- Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException):
- Android自动化大讲堂30--Instrumentation自动化条件
- Android自动化大讲堂36--UIAutomator测试项目创建
- Android自动化大讲堂37--UIAutomator API详解之给力的手势
- Android自动化大讲堂34--终极自动化框架UIAutomator使用详解
- Android自动化大讲堂31--Instrumentation捕获项目控件
- 5.虚拟机性能监控与故障处理工具
- 妙用XML实体引用
- 编译UPX加壳工具
- zTree ctrl 多选功能
- 大数据之:影像提取中深度学习样本库获取的思考