Introduction of Monkey Test
Monkey Test is an Android platform automated testing means, through the Monkey program simulation of User touch screen, sliding trackball, buttons, and other operations to the device on the pressure test procedures, the detection of how long time will occur abnormal.
Ii. Introduction of Monkey procedure
1 Monkey Program is brought by the Android system, written in the Java language, in the Android file system storage path is:/system/framework/monkey.jar;
2 The Monkey.jar program is initiated by a shell script called "Monkey", where the shell script is stored in the Android file system:/system/bin/monkey; This can be done through the cmd window: adb Shell Monkey {+ command parameters} for monkey testing.
There are more than 10 kinds of item in the list, and there are several heavy-duty controls that have an infinite scrolling horizontal banner and a Taobao headline-like control that can scroll infinitely vertically. Worry about memory leaks or other problems, so use the Mokey test to quickly slide to discover hidden problems.
Run
monkeyrunner fling.py
View the Android Monitor memory is also released
The test code is as follows
The code is as follows fling.py
#!/usr/bin/env monkeyrunner
Import time
from Com.android.monkeyrunner import Monkeyrunner, Monkeydevice
device = monkeyrunner.waitforconnection (5)
# fling up
def scrollupfling ():
Device.touch (100, 500, Monkeydevice.down)
Device.touch (MB, monkeydevice.move)
Device.touch (MB, monkeydevice.up)
Print "Fling Up"
# Fling down
def scrolldownfling ():
Device.touch (MB, monkeydevice.down)
Device.touch (M, monkeydevice.move)
Device.touch (+, monkeydevice.up)
print "Fling Down"
Def Fling (): For
I in range (1,1000):
scrollupfling ()
Time.sleep (0.1)
scrolldownfling (
) Time.sleep (0.1)
Fling ()
The above is a small set to introduce the use of Monkey command operation screen Fast sliding, I hope to help everyone, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!