
If you provide this argument, the monkeyrunner command runs the contents To specify more than oneįile, include the argument multiple times. To learn more about monkeyrunner plugins, seeĮxtending monkeyrunner with plugins. jar file containing a plugin for monkeyrunner. Table 1 explains the flags and arguments. The syntax of the monkeyrunner command is Runs the file's contents as a Python program otherwise, it starts an interactive session. If you provide a filename as an argument, the monkeyrunner command Which is found in the tools/ subdirectory of your SDK directory. You do both by invoking the monkeyrunner command You can either run monkeyrunner programs from a file, or enter monkeyrunner statements inĪn interactive session. Than one module in the same from statement by separating the module names with Where is the class name you want to import. The monkeyrunner toolĭoes not import these modules automatically. In a Python program, you access each class as a Python module. This class provides methods for capturing screens,Ĭonverting bitmap images to various formats, comparing two MonkeyImage objects, and You also use this class to run test packages. Uninstalling packages, starting an Activity, and sending keyboard or touch events to anĪpplication. This class provides methods for installing and It also provides methods forĬreating UIs for a monkeyrunner program and for displaying the built-in help.

This class provides a method forĬonnecting monkeyrunner to a device or emulator. The monkeyrunner API is contained in three modules in the packageĪ class of utility methods for monkeyrunner programs. Result.writeToFile('myproject/shot1.png','png') # sets the name of the component to startĭevice.startActivity(component=runComponent)ĭevice.press('KEYCODE_MENU', MonkeyDevice.DOWN_AND_UP) # sets a variable with the name of an Activity in the packageĪctivity = '.MainActivity' # sets a variable with the package's internal name Notice that this method returns a boolean, so you can testĭevice.installPackage('myproject/bin/MyApplication.apk') # Connects to the current device, returning a MonkeyDevice objectĭevice = MonkeyRunner.waitForConnection() # Imports the monkeyrunner modules used by this programįrom import MonkeyRunner, MonkeyDevice The program then takes a screenshot of the result, creating aįrom this object, the program writes out a. Package, runs one of its activities, and sends key events to the activity.
POPKEY ANDROID ANDROID
Using the MonkeyDevice object, the program installs an Android application Here is a simple monkeyrunner program that connects to a device, creating a Use Python syntax to access the constants, classes, and methods of the API. Monkeyrunner API to interact easily with the Android framework. Implementation of Python that uses the Java programming language. You can also add your own classes to the monkeyrunner API. The monkeyrunner API itself, you can use the standard Python System of Python-based modules and programs for controlling Android devices. Regression testing - monkeyrunner can test application stability by running an applicationĪnd comparing its output screenshots to a set of screenshots that are known to be correct.Įxtensible automation - Since monkeyrunner is an API toolkit, you can develop an entire You provide input values with keystrokes or touch events, and view the results You can also start up an emulatorĬonfiguration programmatically, run one or more tests, and then shut down the emulator.įunctional testing: monkeyrunner can run an automated start-to-finish test of an AndroidĪpplication. Programmatically, and then run one or more tests. Or start up all the emulators (or both) at once, connect to each one in turn You can physically attach all the devices Test suites across multiple devices or emulators. Multiple device control: The monkeyrunner API can apply one or more
POPKEY ANDROID FOR ANDROID
The monkeyrunner tool provides these unique features for Android testing: The monkeyrunner tool controls devices and emulators from a workstation by sending specific The monkey tool runs in anĭevice or emulator and generates pseudo-random streams of user and system events. The monkeyrunner tool is not related to theĪlso known as the monkey tool.
POPKEY ANDROID FREE
Monkeyrunner tool is primarily designed to test applications and devices at theįunctional/framework level and for running unit test suites, but you are free to use it forĬaution: The monkeyrunner API is unmaintained.

Takes screenshots of its user interface, and stores screenshots on the workstation. That installs an Android application or test package, runs it, sends keystrokes to it, With monkeyrunner, you can write a Python program
.jpeg)
Or emulator from outside of Android code.
