monkey基础知识(二)

Monkey测试策略介绍

例一:整机测试,不测试打电话功能,忽略所有错误,次数100万次

前提:准备好blacklist.txt文件,讲文件push到手机data/local/tmp目录中

adb shell monkey --ignore-crashes --ignore-timeouts --pkg-blacklist-file /data/local/tmp/blacklist.txt -v -v 1000000

 例二:测试计算器30万次,随机种子为100,随机延迟0到1秒,忽略所有错误

adb shell monkey -p com.android.calculator2 -s 100 --ignroe-crashes --ignore-timeouts  --throttle 1000 --randomize-throttle -v -v  300000

例三:测试计算器10万次,触摸事件30%,其它事件50%,错误停止,延时200毫秒

adb shell monkey -p com.android.calculator2 --pct-touch 30 -pct-anyevent 50 --throttle 200 -v -v 100000

例四:对计算器进行旋转压力测试,延时2秒,10万次

adb shell monkey -p com.android.calculator2 --pct-rotation 100 --throttle 2000 -v -v 100000

例五:仅对整机的应用开启测试,时间延时5秒,10万次

adb shell monkey --pct-appswitch 100 --throttle 5000 10000

posted @ 2016-03-29 10:29  深梦  阅读(445)  评论(0编辑  收藏  举报