uiautomator——第一个例子:打开浏览器,输入网址

1、在sdk安装目录:E:\Test_Tools\auto_test\app\adt-bundle-windows-x86-20131030\sdk\tools下启动uiautomatorviewer.bat

2、在UI Automator Viewer中同步手机屏幕
3、每次要获取元素信息时,都要重新获取屏幕信息
 
4、在eclipse中新建一个java工程,在工程中新建libs文件夹
5、进入E:\Test_Tools\auto_test\app\adt-bundle-windows-x86-20131030\sdk\platforms\android-17路径(根据你们的sdk安装路径来,选择和你们的jre system library一样的版本,我的是JavaSE-1.7所以选择android-1.7目录)。
将uiautomator.jar和android.jar拷贝到libs中
6、在libs中选择这两个jar包,单击右键,选择Build Path-->add to Build Path
build前:                                                                 
 
build后:
posted @ 2016-01-28 20:28  深梦  阅读(679)  评论(0)    收藏  举报