压力测试 第一次接触这个概念,客户端做压力测试,没听说过。其实是有的,典型:疯狂的点击屏幕。今天试验了一把,原理:用脚本疯狂去模拟点击事件,如何去模拟点击事件呢,就是好比一个人,随便去点,不一定非得就去点击有反应的控件。
看看打印的log:
m.android.settings/.WirelessSettings } in package com.android.settings
:Sending Pointer ACTION_DOWN x=209.0 y=147.0
:Sending Pointer ACTION_UP x=209.0 y=147.0
:Sending Pointer ACTION_MOVE x=-2.0 y=0.0
// Rejecting start of Intent { act=android.intent.action.MAIN cat=[android.i
ntent.category.HOME] cmp=com.android.launcher/.Launcher } in package com.android //这种非本程序的包,是不去模拟的
.launcher
:Sending Pointer ACTION_DOWN x=219.0 y=29.0 //疯狂模拟各个位置的点击事件
:Sending Pointer ACTION_UP x=219.0 y=29.0
:Sending Pointer ACTION_DOWN x=319.0 y=18.0
:Sending Pointer ACTION_UP x=319.0 y=18.0
:Sending Pointer ACTION_DOWN x=179.0 y=91.0
:Sending Pointer ACTION_UP x=179.0 y=91.0
:Sending Pointer ACTION_DOWN x=212.0 y=176.0
:Sending Pointer ACTION_UP x=212.0 y=176.0
:Sending Pointer ACTION_DOWN x=196.0 y=193.0
:Sending Pointer ACTION_UP x=196.0 y=193.0
:Sending Pointer ACTION_MOVE x=-5.0 y=-2.0
// CRASH: com.acp.main (pid 325)
// Short Msg: Array index out of range: 0
// Long Msg: java.lang.ArrayIndexOutOfBoundsException: Array index out of range://程序出问题了,数组越界了,测试到这,测试就会自动停止了。
0
// Build Label: android:generic/sdk/generic/:2.1-update1/ECLAIR/35983:eng/test-k
eys
// Build Changelist: 35983
// Build Time: 12731