maxim - Android UI压力测试

项目介绍

  • 项目地址:https://github.com/zhangzhao4444/Maxim
  • 与monkey对比优势:
    • 稳:只进行有意义的操作,防误点状态栏,不会乱断网、卸载应用
    • 支持脱机运行,错误日志可以记录到手机本地
    • 支持自定义:控件黑白名单,自定义操作步骤,控件操作优先级
    • 截图支持

使用方法

  1. 将两个jar文件push到根目录 maxim.zip

    adb push framework.jar /sdcard   
    adb push monkey.jar /sdcard
  2. 脱机运行方法(开始执行后,手机可以不连接电脑,错误日志记录在手机存储卡上)

    adb  shell  "CLASSPATH=/sdcard/monkey.jar:/sdcard/framework.jar exec app_process /system/bin tv.panda.test.monkey.Monkey -p com.hs.news --uiautomatormix --running-minutes 2880 -v  --throttle 500 >/sdcard/monkeyout.txt 2>/sdcard/monkeyerr.txt &"
      
    参数含义:
    -p com.hs.news:指定要运行的包名,需要替换成你在测试的应用
    --uiautomatormix:遍历方式,其它两个不稳定,可以默认用这个
    --running-minutes  2880 :指定运行时间,单位是分钟, 2880 就是 2
    -v:log输出级别
    --throttle  500 :每个动作之间间隔,如果不加会以尽可能快的速度发送指令。为了模拟正常操作,一般设置在 300 以上
    2 >/sdcard/monkeyerr.txt:如果运行过程中出现崩溃卡死,错误文件会保存在这里。
  3. 非脱机运行方法(开始执行后,手机必须连接电脑,错误日志记录在电脑上)

    adb shell CLASSPATH=/sdcard/monkey.jar:/sdcard/framework.jar exec app_process /system/bin tv.panda.test.monkey.Monkey -p com.hs.news --uiautomatormix --running-minutes  60  -v -v > D:\test\monkey.log  2 >D:\test\monkeyerr.log
  4. 运行结束后,查看错误文件中是否有报错信息,手机上:adb pull /sdcard/monkeyerr.txt,电脑上:D:\test\monkeyerr.log

  5. 在结果文件中,搜索crash,not responding,和你测试的包名,找出崩溃卡死等信息

猜你喜欢

转载自www.cnblogs.com/QaStudy/p/11791179.html