Monkey Test正常结束的时间为何不同

[DESCRIPTION]


Monkey测试时使用同样的测试命令,正常结束的时间各不相同。
比如使用下面的命令,有的手机正常结束的时间大约为60小时,而有的却超过80小时测试仍未停止

adb shell monkey --pkg-blacklist-file /sdcard/blacklist.txt --ignorecrashes
--ignore-timeouts --ignore-security-exceptions --ignore-nativecrashes
--monitor-native-crashes -s 800 -v -v -v --throttle 200 3000000
>sdcard/monkey.log


[SOLUTION]


从monkey log中可以看到如下信息:
Events injected: 3000000
:Sending rotation degree=0, persist=false
ropped: keys=1250 pointers=2646 trackballs=0 flips=0 rotations=0
## Network stats: elapsed time=218276905ms (0ms mobile, 11885542ms WIFI,
206391363ms not connected)
// Monkey finished
Monkey测试执行时间为218276905ms,也就是大约60.6h。
按照测试命令来看,有加入200ms时延,3000000次事件,应该执行166.7h才对。
查看monkey log,就会发现是一系列的event发完后才会插入200ms时延。
比如 key-down / key-up, touch down / several touch move / up , a serial of
track ball move
Sleeping for 200 milliseconds//加入200ms时延
:Sending Key (ACTION_DOWN): 82 // KEYCODE_MENU
:Sending Key (ACTION_UP): 82 // KEYCODE_MENU
Sleeping for 200 milliseconds
:Sending Trackball (ACTION_MOVE): 00.0,1.0)
:Sending Trackball (ACTION_MOVE): 03.0,1.0)
:Sending Trackball (ACTION_MOVE): 03.0,-4.0)
:Sending Trackball (ACTION_MOVE): 0-3.0,0.0)
:Sending Trackball (ACTION_MOVE): 0-4.0,-1.0)
:Sending Trackball (ACTION_MOVE): 03.0,0.0)
:Sending Trackball (ACTION_MOVE): 03.0,0.0)
:Sending Trackball (ACTION_MOVE): 0-4.0,-4.0)
:Sending Trackball (ACTION_MOVE): 0-3.0,0.0)
:Sending Trackball (ACTION_MOVE): 0-3.0,-2.0)
:Sending Trackball (ACTION_DOWN): 0:(0.0,0.0)
:Sending Trackball (ACTION_UP): 0:(0.0,0.0)
Sleeping for 200 milliseconds
:Sending Key (ACTION_DOWN): 192 // KEYCODE_BUTTON_5
:Sending Key (ACTION_UP): 192 // KEYCODE_BUTTON_5
由于Monkey Test是随机测试,所以使用相同的测试命令,测试时间会有不同是正常
现象。

 

 

此资料( Monkey Test正常结束的时间为何不同)转载于 一牛网
资料需要自己去下载,有需要的可以去论坛上面自己下载

posted @ 2016-04-08 14:42  16rd  阅读(950)  评论(0编辑  收藏  举报