精通移动APP测试实战:技术、工具和案例--Monkey

本文为书籍《精通移动App测试实战:技术、工具和案例》的阅读笔记,仅作学习)记录,感谢书籍作者提供的学习机会。
1、Monkey测试
Monkey可以向被测试的应用程序发送伪随机的用户事件流(如按键、触屏、手势等),实现对应用程序进行测试的目的。

2、adb shell monkey 查看monkey命令用法
3、adb shell monkey-p com.android.calendar 1000

1000:发送1000次随机事件
在这里插入图片描述elapsed time:网络统计共耗时3821 ms(毫秒)
mobile:耗费在手机上的时间
wifi:花费在无线网络上的时间,
not connectd:浪费在没有连接的时间
-p:指定要运行的包 指定多个包:-p 包名 -p 包名
-v:参数可以指定打印信息的详细级别(0-2级)。每多包含一个“-v”就增加一个信息的详细级别,默认级信息的详细级别为0(1个-v)

4、设置各种事件的比例
事件相关参数:
在这里插入图片描述
约束条件:
在这里插入图片描述
调试选项:
在这里插入图片描述throttle选项:adb shell monkey -p com.android.calendar–throttle 3000 100
–pct-touch 选项:adb shell monkey --pct-touch 50 -p com.android.calendar–throttle 3000 100
–pct-motion :adb shell monkey --pct-motion 50 -p com.android.calendar–throttle 3000 100
–pct-trackball :adb shell monkey --pct-trackball 50 -p com.android.calendar–throttle 3000 100
–pct-nav :adb shell monkey --pct-nav 50 -p com.android.calendar–throttle 3000 100
–pct-majornav :adb shell monkey --pct-majornav 50 -p com.android.calendar–throttle 3000 100
–pct-syskeys :adb shell monkey --pct-syskeys 50 -p com.android.calendar–throttle 3000 100
–pct-appswitch :adb shell monkey --pct-appswitch 50 -p com.android.calendar–throttle 3000 100(覆盖包中50%的活动)
–pct-anyevent :adb shell monkey --pct-anyevent 50 -p com.android.calendar–throttle 3000 100
–hprof:
–ignore-crashes:adb shell monkey -p com.android.calendar --ignore-crashes 100
–ignore-timeouts:adb shell monkey -p com.android.calendar–ignore-timeouts 100
–ignore-security-exceptions:adb shell monkey -p com.android.calendar–ignore-security-exceptions 100

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值