monkey日志分析

日志开头:

显示本次测试seed值,执行次数,测试包

C:\Users\86183>adb shell monkey -p com.ss.android.article.news  --ignore-timeouts --ignore-native-crashes -v 200
:Monkey: seed=1639350920122 count=200
:AllowPackage: com.ss.android.article.news
:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY

 

 日志结尾:

如果Monkey测试顺利执行完成,在log的最后,会打印出当前执行事件的次数和所花费的时间;Monkey finished代表执行完成。
如果Monkey执行中断,在log的最后也能查看到当前已执行的次数。

** Monkey aborted due to error.
Events injected: 1647
:Sending rotation degree=0, persist=false
:Dropped: keys=1 pointers=0 trackballs=0 flips=0 rotations=0
## Network stats: elapsed time=42736ms (0ms mobile, 0ms wifi, 42736ms not connected)
** System appears to have crashed at event 1647 of 2000 using seed 1639427918325

 

 

 

日志内容分析:

一般测试结果分析-搜索关键字:

1)搜索报告中的关键字“ANR”,看有无应用无响应的事件(Application Not Responding)
2)搜索报告中的关键字“crash”,看有无崩溃的事件
3)搜索报告中的关键字“exception”,看有无其他异常事件。(如果出现空指针, NullPointerException,需格外重视)
4)内存泄露问题搜索"GC"(需进一步分析)

 

详细分析monkey日志:

Switch--查看log中的Switch,主要是查看Monkey执行的是那一个Activity,两个swtich之间如果出现了崩溃或其他异常,可以在该Activity中查找问题的所在。

Sleeping--Sleeping for 500 milliseconds这是执行Monkey测试时,throttle设定的间隔时间,每出现一次,就代表一个事件。

 

重现问题:

Monkey测试出现错误后,一般的查错步骤为以下几步:
1.找到是monkey里面的哪个地方出错
2.查看Monkey里面出错前的一些事件动作,并手动执行该动作
3.若以上步骤还不能找出,可以使用之前执行的monkey命令再执行一遍,注意seed值要一样

一般 0 ANR 0 CRASH是测试标准。

 

 

以上内容 摘录于:https://blog.csdn.net/qq_15158911/article/details/53444821?utm_source=copy  

posted @ 2021-12-11 18:51  eosclover  Views(293)  Comments(0Edit  收藏  举报