Links to automated test history articles

Android Monkey stress test 2.Android Monkey advanced parameter application 3.Android MonkeyScript command simple application 4 The application of UiAutomator2.0

Why stress tests?

2. Improve the retention rate of the product

When will stress tests be carried out?

1. After passing the first round of functional sequencing 2

What is the Monkey?

Monkey is a tool for sending pseudo-random user events.

What is a MonkeyScript

MonkeyScript is a set of commands that can be identified by the Monkey. MonkeyScript can do repetitive fixed operations.

What is MonkeyRunner?

MonkeyRunner provides a series of apis. MonkeyRunner can simulate events and take screenshots.

The difference between Monkey and MonkeyRunner

Monkey: In ADB Shell, generates pseudo-random events for the user or system. MonkeyRunner: Controls devices by defining specific commands and events through an API.

MonkeyRunner APIs

MonkeyRunner: Used to connect to devices or emulators. MonkeyDevice: Installs and uninstalls applications and sends simulated events. MonkeyImage: Complete the operation of image saving and comparison.

Stress test results

1. “Crash” : Indicates that the application exits abnormally when it is in use. 2.ANR: Application Not Responding

The environment

Andrid SDK (ADB, Monkey) Python

Simple to use

Adb connects to the phone/box, enter the following command, and randomly execute 1000 commands

adb shell monkey 1000
Copy the code

Activitydashing (com.android.settings) Indicates that com.android. Settings has been switched from background to foreground. The content in parenthesis is the application package name. Events injected 1000 correspond to ADB Shell Monkey 1000. 1000 means that the 1000 Events are properly applied and normal. If an exception occurs, the number will be less than the number of instructions after the ADB Shell Monkey.

Specify the Monkey test to apply

adb shell monkey -p packageName 1000
Copy the code

Monkey tests the specified application with packageName replacing the real packageName of the application being tested. Adb shell monkey -p com.android. Settings 1000 indicates that 1000 events are randomly executed in the com.android. Settings application

If you liked this article or helped you, please give me a Star

https://github.com/peace710/AJLife