Appium automated testing tutorial - self indirect network -monkeyrunner

 

About monkeyrunner

MonkeyRunner tool is to use Jython (Python Java programming language using a) written, which provides multiple API, you can write a Python program by monkeyrunner API to simulate the operation of the control device Android app, and can be tested for stability by screenshots easily record the problem.

Official website describes as follows

The monkeyrunner tool provides an API for writing programs that control an Android device or emulator from outside of Android code. With monkeyrunner, you can write a Python program that installs an Android application or test package, runs it, sends keystrokes to it, takes screenshots of its user interface, and stores screenshots on the workstation. The monkeyrunner tool is primarily designed to test applications and devices at the functional/framework level and for running unit test suites, but you are free to use it for other purposes.

monkeyrunner tool provides an API, for writing Android program control from outside the device or emulator Android code. By monkeyrunner, you can write a Python program to install Android applications or test package, run it and it sends the key event to intercept screenshots of its user interface, and stored on the workspace screen shots. monkeyrunner tool designed primarily for functional / framework level test applications and devices, as well as run the unit test suite, but you are free to use it for other purposes.

monkeyrunner 路径:Andriod_SDK\tools

MonkeyRunner function

1. The multi-device control: API across multiple devices, all of the starting primary embodiment simulator test suite;

2. functional testing: an application to automatically perform a functional test, then look at the output of screenshots.

3. Scalable automation: Because monkeyrunner is an API toolkit, you can develop the entire system based on Python module to control Android devices;

Monkeyrunner and Monkey difference

monkeyrunner and money is no direct relationship, monkey running adb shell command to generate random events to test directly in the device. In comparison, monkeyrunner is to send specific commands and events to control the device via the API.

monkeyrunner environment to build

·  Installed and configured jdk environment

·  Install android sdk

·  Install python installation configuration tutorial 

·  The monkeyrunner environment variable configuration: {Path} \ Andriod_SDK \ tools

 

Installation detected result

Enter the command in the console: the following content monkeyrunner display appears the installation was successful

C:\Users\Shuqing>monkeyrunner

Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:54:35)

[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_05

>>>

Tips:退出monkeyrunner命令行模式可以 使用快捷键 ctrl+D退出。

 

Guess you like

Origin www.cnblogs.com/lp475177107/p/11960012.html