Monkey Test 1 -- Use of Monkey, monkey test 1
1 Monkey tool 2 3 1. What is Monkey 4 5 Monkey is a command line tool in Android, which can be run in the simulator or on the actual device. It sends a pseudo-random user event stream (such as key input, touch screen input, and gesture input) to the system to perform stress testing on the application being developed. Monkey testing is a fast and effective method to test the stability and robustness of software. 6 2. Monkey features 8 9 1. The test object is only an application package and has certain limitations. 10 11 2. The event stream data stream used for Monkey testing is random and cannot be customized. 12 13 3. You can set the MonkeyTest object, event quantity, type, and frequency. 14 15 3. Basic usage of Monkey 16 17 basic syntax: 18 19 $ adb shell monkey [options] 20 21 if no options is specified, Monkey will be started in non-feedback mode, and send any event to all packages installed in the target environment. The following is a more typical command line example. It starts the specified application and sends 500 pseudo-random events to it: 22 23 $ adb shell monkey-pyour. package. name-v 500 24 25 4. A Monkey test instance 26 27 passed this instance. We can understand the Monkey test steps and how to know which applications can be tested with Monkey. 28 29 Windows (Note: steps 2 and 4 are used to check which application packages can be tested, which can be omitted ): 30 31 1. Start an Android emulator 32 33 through eclipse 2. Enter adb devices in the command line to view the device connection status 34 35 C: \ Documents andSettings \ Administrator> adb devices 36 37 List of devices attached 38 39 emulator-5554 device 40 41 3. If a device is connected, enter: adb shell enter shell Interface 42 43 C: \ Documents ents andSettings \ Administrator> adb shell 44 45 #46 47 4. view the application packages in the data/data folder. Note: The application packages we can test are all under 48 49 C in this directory: \ Documents andSettings \ Administrator> adb shell 50 51 # ls data/data 52 53 ls data/data 54 55 com. google. android. btrouter 56 57 com. android. providers. telephony 58 59 com. android. mms 60 61 com. android. providers. downloads 62 63 com. android. deskclock 64 65 com. android. email 66 67 com. android. providers. media 68 69 com. android. settings 70 71 jp. co. omronsoft. openwnn 72 73 com. Android. providers. userdictionary 74 75 com. android. quicksearchbox 76 77 com. android. protips 78 79 com. android. browser 80 81 com. android. launcher 82 83 com. android. term 84 85 com. android. speechrecorder 86 87 com. android. server. vpn 88 89 com. android. defcontainer 90 91 com. svox. pico 92 93 com. android. customlocale 94 95 com. android. development 96 97 com. android. soundrecorder 98 99 com. android. provide Rs. drm100 101 com. android. spare_parts102 103 com. android. providers. downloads. ui104 105 com. android. fallback106 107 com. android. providers. applications108 109 com. android. netspeed110 111 com. android. wallpaper. livepicker112 113 android. tts114 115 com.android.html viewer116 117 com. android. music118 119 com. android. certinstaller120 121 com. android. inputmethod. pinyin122 123 com. android. providers. subscrib Edfeeds124 125 com. android. inputmethod. latin126 127 com. android. gallery128 129 com. android. systemui130 131 com. android. contacts132 133 com. android. phone134 135 com. android. sdksetup136 137 com. android. calculator2138 139 com. android. packageinstaller140 141 com. android. camera142 143 com. android. providers. settings144 145 com. thestore. main146 147 com. android. providers. contacts148 149 5. Use com. android. ca Lculator2 is used as the object for MonkeyTest150 151 # monkey-p com. android. calculator2-v 500152 153 where-p represents the object package-v represents the number of events 154 during runtime, applications in Emulator are constantly switching the screen. 156 157 according to the selected feedback information of different levels, you can also see the execution process report and generated events in the Monkey. 158 159 Note: specific parameter settings can be referred to: 160 161 http://developer.android.com/guide/developing/tools/monkey.html162 163 v. About the Monkey Test stop condition 164 165 Monkey Test will be automatically stopped in the following three conditions during execution: 166 167 1. If Monkey is limited to one or more specific packages, it will monitor and block operations that attempt to switch to other packages. 168 169 2. If the application crashes or receives any runaway exceptions, the Monkey stops and reports an error. 170 171 3. If the application generates an applicationnot responding error, the Monkey will stop and report an error. 172 173 it is considered a stable program after multiple Monkey tests with different settings.