MonkeyRunner_模拟机_运行脚本

1.打开创建好的Android模拟机  (使用AVD Manager.exe打开,或者使用cmd窗口 emulator -avd test2打开)

MonkeyRunner_模拟机_运行脚本

2.打开cmd窗口,输入monkeyrunner,然后输入相应的脚本执行

MonkeyRunner_模拟机_运行脚本

3.安装apk

result=device.installPackage('d:\mk\yjyphone.apk')

device.touch(800,1900,'DOWN_AND_UP')

device.startActivity(component="com.xxx.phone/com.xxx.phone.activity.WelcomeActivity") 
device.drag((400,600),(60,600),0.1,10) 
device.drag((400,600),(60,600),0.1,10)

device.touch(530,1600,'DOWN_AND_UP')

4.选中学校的坐标为(331,545),单位:像素

device.touch(331,545,'DOWN_AND_UP')

device.touch(331,1850,'DOWN_AND_UP')

6.输入用户名密码并登录

device.type('accounts')

device.type('\n')

device.type('password')

device.touch(260,820,'DOWN_AND_UP')

7.首页界面

device.touch(100,158,'DOWN_AND_UP')

device.touch(400,158,'DOWN_AND_UP')

device.touch(700,158,'DOWN_AND_UP')

device.touch(1000,158,'DOWN_AND_UP')

device.touch(1300,158,'DOWN_AND_UP')

device.touch(100,1900,'DOWN_AND_UP')

device.touch(500,1900,'DOWN_AND_UP')

device.touch(900,1900,'DOWN_AND_UP')

device.touch(1300,1900,'DOWN_AND_UP')

上一篇:PHP回调函数call_user_func()和call_user_func_array()的使用


下一篇:OpenCV 视频处理框架