Although the general company has specialized testers, but sometimes we have to go to develop products, but also to test products, testing products, some mechanized point interface operation, Google has provided us with tools, Monkey, monkey Test.
What is Monkey
Monkey is a command-line tool in Android that can be run in the emulator or in the actual device. It sends pseudo-random user event streams (such as key input, touch input, gesture input, etc.) to the system, enabling stress testing of the application under development. Monkey testing is a fast and effective method to test the stability and robustness of the software.
Characteristics of Monkey
1, the test object is only the application package, there are certain limitations.
2. The event stream data stream used by the Monky test is random and cannot be customized.
3, can set the Monkeytest object, the number of events, type, frequency, etc.
Basic usage of Monkey
The basic syntax is as follows:
$ adb shell monkey [options]
If you do not specify Options,monkey will start in a no-feedback mode and send events to all packages installed in the target environment. The following is a more typical command-line example that launches a specified application and sends 500 pseudo-random events to it:
$ adb shell Monkey-p your.package.name-v 500
About the stop condition for the monkey test
Monkey test will automatically stop in the following three scenarios during execution:
1. If monkey is qualified to run on one or several specific packages, it will monitor and block attempts to move to other packages.
2. If the application crashes or receives any runaway anomalies, the monkey will stop and error.
3. If the application produces an error that the application does not respond (application not responding), the monkey will stop and make a mistake.
It is a stable enough program to pass multiple and different sets of monkey tests.
Of course, the monkey test is the most basic test, its test is immediately click, may click on the application, may also be broken network, and so on, a series of possible operations, although the comparison of the basis, but how much is useful, if the detection of problems then the application will crash, in DOS can see the error, For example, I test the demo myself.
------Monkey Tools for Android automated testing