- 24
- 0
- 约7.96千字
- 约 11页
- 2018-02-17 发布于浙江
- 举报
uiautomator使用手册
使用环境: 1
Android Document: 4
创建一个uiautomator的测试工程: 4
运行比较简单: 4
怎么建立一个工程: 4
1. 创建测试工程 4
2. Eclipse创建一个工程(见上) 4
3. 编写代码 5
4. Build(通过Eclipse见上图),ant build 5
操作类函数: 5
点屏幕上的控件或坐标操作 5
拖拽 6
长按 6
其他操作 7
获得屏幕属性的函数接口: 8
验证工作: 9
强大的监控管家, 10
使用环境:
JDK
/technetwork/java/javase/downloads/index.html
安装后应该JAVA_HOME在环境变量里面,如果没有手动加,比如我的是JAVA_HOME C:\Program Files\Java\jdk1.7.0_17
Android SDK
/sdk/index.html
环境变量:
ANDROID_HOME=你的android sdk根目录,我的是C:\adt-bundle-windows-x86_64sdk
Adb环境变量,tools环境变量 比如我的是
C:\adt-bundle-windows-x86_64sdk\tools;C:\adt-bundle-windows-x86_64sdk\platform-tools
Monitor.bat 在tools里可以找到,用来查看屏幕上的组件
WinAnt 编译工具
/p/winant/downloads/list
安装完之后应该就有环境变量
ANT_HOME=C:\Program Files (x86)\WinAnt
Better to have:
Eclipse用于编写编译:
/downloads/
Eclipse IDE for Java Developers,
步骤:
Create a new Java project in Eclipse, and give your project a name that is relevant to the tests you’re about to create (for example, MyAppNameTests). In the project, you will create the test cases that are specific to the application that you want to test.
From the?Project Explorer, right-click on the new project that you created, then select?Properties Java Build Path, and do the following:
Click?Add Library JUnit?then select?JUnit3?to add JUnit support.
Click?Add External JARs...?and navigate to the SDK directory. Under the platforms directory, select the latest SDK version and add both the?uiautomator.jar?and?android.jar?files.
在eclipse配置ant build,如果不想使用eclipse编译而手动使用ant build命令来编译也行也挺方便。
Your project 右键Properties,Builders-New-
Set Targets: 选择build 和jar:
Android Document:
/tools/testing/testing_ui.html
/tools/testing/testing_ui.html#configure
/tools/help/uiautomator/index.html
创建一个uiautomator的测试工程:
android-sdk/tools/android create uitest-project -n name -t 1 -p path
-t android_id必须大于等于16, 用android list可以得到当前列表
建议只下载android4.2.2,因为api=16里面接口太少了,达不到使用的目的,手机也必须刷成android4.2.2的(现在Dongo,Odin, Pelican都可以)
注意:拷贝实例中的工程需要修改perties
注销掉这种字眼#sdk.dir=C:\\adt-bundle-windows-x86
您可能关注的文档
- riil操作手册.docx
- scms产品简易操作手册.docx
- sg-uap_v2.0_bpm安装配置手册.doc
- shiro使用方法.ppt
- shopnc操作手册-平台后台-v1.2.docx
- sms平台功能简单说明.doc
- sophia--岗位分析.ppt
- springmvc常用注解说明.docx
- struts2开发手册.ppt
- sy8100c模板使用说明.doc
- 浙江省温州市2024-2025学年七年级上学期语文期末考查卷.docx
- 精品解析:北京市建华实验学校2024-2025学年七年级下学期期中英语试题(原卷版).docx
- 精品解析:北京市通州区2024-2025学年七年级下学期期末考试英语试卷(原卷版).docx
- 精品解析:北京市回民学校2024-2025学年九年级上学期期中语文试题(解析版).docx
- 精品解析:北京市海淀区2025-2026学年九年级上学期期末语文试题(解析版).docx
- 精品解析:北京市东城区汇文中学2025-2026学年八年级上学期期中语文试题(原卷版).docx
- 精品解析:北京市回民学校2024-2025学年九年级上学期期中语文试题(原卷版).docx
- 精品解析:2024-2025学年广东省广州市从化区街口镇中心小学人教版五年级上册期中测试数学试卷(解析版).docx
- 精品解析:北京市通州区2024-2025学年七年级下学期期末考试英语试卷(解析版).docx
- 精品解析:北京市建华实验学校2024-2025学年七年级下学期期中英语试题(解析版).docx
最近下载
- 2025年青岛电影学院教师招聘考试笔试模拟试题及答案解析.docx VIP
- 市政工程监理质量评估报告.docx VIP
- “学校青年教师专业发展路径研究”课题申报书.doc
- SLT 791-2019 -水库降等与报废评估导则.pdf VIP
- 邹仲之《组织学与胚胎学》9眼和耳01.ppt VIP
- 《论语》十二章理解性默写(带答案).pdf VIP
- X商业银行金融科技人才招聘管理优化研究.pdf VIP
- 邹仲之《组织学与胚胎学》25泌尿系统和生殖系统的发生.ppt VIP
- 《富致秘录》中源线建仓法(陈雅山 著 王明森 点校).pdf VIP
- 关于《宁波大学本科课程考核及成绩管理办法》的修订说明.doc VIP
原创力文档

文档评论(0)