Lijie xia lx223809 monkeyrunner

713 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
713
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
22
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Lijie xia lx223809 monkeyrunner

  1. 1. MonkeyRunner Author: Lijie Xia
  2. 2. What is Monkeyrunner  Providing an API for writing programs that control an android device or emulator from outside of Android code.  Writing python based test tool and runing python script for testing.  Sending keystrokes to device, takes screenshots of its user interface, and stores screenshots on the workstation.  Testing applications and devices at the functional/framework level and for unit test.
  3. 3. What can Monkeyrunner Do  Multiple device control  Functional testing  Regression testing  Extensible automation
  4. 4. Multiple Device Control  Apply one or more test suites across multiple devices or emulators  Physically attach all the devices or start up all the emulators (or both) at once, connect to each one in turn programmatically, and then run one or more tests.  Start up an emulator configuration programmatically, run one or more tests, and then shut down the emulator Functional testing Regression testing Extensible automation Next Topic
  5. 5. Functional Testing  Monkeyrunner can run an automated start-to-finish test of an Android application.  Programmers provide input values with keystrokes or touch events  Monkeyrunner takes screenshots to show the results. Multiple device control Regression testing Extensible automation Next Topic
  6. 6. Regression Testing  Test application stability by running an application and comparing its output screenshots to a set of screenshots that are known to be correct. Functional testing Extensible automation Multiple device control Next Topic
  7. 7. Extensible Automation  Develop an entire system of Python-based modules and programs for controlling Android devices.  Developers can use the standard Python os and subprocess modules to call Android tools such as Android Debug Bridge. Multiple device control Functional testing Regression testing Next Topic
  8. 8. Modules of Monkeyrunner(1)  MonkeyRunner: A class of utility methods for monkeyrunner programs.    For connecting monkeyrunner to devices and emulators. For creating UIs for Monkeyrunner programs. MonkeyDevice: Represents a device or emulator.  For installing and uninstalling packages.  For starting an Activity.  For sending keyboard or touch events to an application.  Can also be used to run test packages.
  9. 9. Modules of Monkeyrunner(2)  MonkeyImage: Represents a screen capture image.  Capturing screens.  Converting bitmap images.  Comparing two MonkeyImage objects.  Writing images to files.
  10. 10. MonkeyRunner vs. Monkey Tool  Similarity:   Able to run on any emulator instance or on a device. Difference: MonkeyRunner Monkey Tool Write separate python script that can install the program. Generates events and sends them to the system Take screenshot for checking the correctness Test for crash or not.
  11. 11. Sustainability, performance, pricing  Monkeyrunner is a build in tool, which is included in the android SDK tools.  Hence, it’s stabile for android testing and the performance is food.  Also, it’s free since it comes with Android SDK tools.
  12. 12. Benefit/Cost Analysis  Test program is implemented in Python.    Easy to learn. Script is separate with the project files. Able to test on multiple device and emulators at the same time.  Easy and powerful.
  13. 13. Compatibility  Multiple platform can handle MonkeyRunner.  Comes with Android SDK Tools.  Run on multiple devices and simulators.  Python is required.
  14. 14. Sample Code Tutorial
  15. 15. Tutorial / Basic Steps  Installs an application or test package  Runs an application  Send keystrokes or touch events to it  Take screen shots of the user interface  Store screen shots on your workstation
  16. 16. Reference  http://developer.android.com/tools/help/monkeyrunner_concepts.html  http://androidtesting.blogspot.com/2012/03/android-testing-withmonkeyrunner.html  http://androidtesting.blogspot.com/2012/04/monkeyrunner-tutorial-runningtests-on.html  http://antoine-merle.com/introduction-to-the-monkey-runner-tool-2/  http://developer.android.com/tools/help/monkey.html

×