Skip to content
spring60569 edited this page Jul 21, 2014 · 7 revisions


Welcome to the GogoMonkeyRun wiki!

GogoMonkeyRun is an auto-testing tool developed by Po-chi Huang in Gogolook Inc.


As most people know that there are several auto-testing tools for Android.

Namely JUnit, InstrumentationTestCase, uiautomator, Monkey, and MonkeyRunner

JUnit is well-known for testing units, like function or class, but is not suitable for test a complete flow for
an app.

InstrumentationTestCase is some kind like JUnit, and more straightly to test UIs.
However, it is not easy to test functions over an activity and another activity, and also maintaining an
InstrumentationTestCase is such costly.

uiautomator which was revealed in Google I/O at 2013, is a powerful tool to test UIs and functions.
It perfectly solves the weakness mentioned above and keeps the advantages.
Sad enough, it doesn't support Android SDK Platform, under API 16.

For Monkey and MonkeyRunner, we may simulate user actions and take screenshot with MonkeyRunner in python code.
Android even provides a recorder tool called MonkeyRecorder to record actions.
Through the recorded actions, we may generate our python script for MonkeyRunner.
Does it seem so well?
Unfortunately, everything we talked about here was so un-straight...such a mess...

GogoMonkeyRun, the role of this article, is developed based on Monkey and MonkeyRunner.
GogoMonkeyRun does not only make everything visualization, but also solves the weakness of them.
If auto-testing includes screenshot, it would compare the result each time running the script.
It even can report crash!

Installation


Pull project from git repository: https://github.com/Gogolook-Inc/GogoMonkeyRun.git

Open or unzip GogoMonkeyRun1_0_2.zip, and we'll see the following picture.
Files needed
These files are needed in the same directory.
Double-click Application.jar to open application.

First Time to Open Application

Set SDK path
Don't worry if see this alert.
SDK-path must be set at the first time.

select sdk directory
Select the right sdk path.

Select a device
Select a device to perform auto-testing.

Set crash repot Set crash report2
Setting crash report, just input your email address and password.
If crash report is not set, we still can find the error report in the directory of app.

Start Record a Script

Make a record
If there are no action recorded before, please make a new record here.
After press "yes", we may see a MonkeyRecorder shown.

Notice that this recorder is not like the original one.
I make a new plug-in to enhance flexibility of original one.
The following shows the comparison.
Compare of new MonkeyRecorder and Old one
The right one is the new MonkeyRecorder, and the left one is the original.
Noticed that, compare to the original one, button of fling is removed.
To perform fling(or drag), just use mouse to perform drag action.

After exporting actions and exiting MonkeyRecorder, GogoMonkeyRun would generate a python script.
In fact, we may directly run this python script to perform auto-testing. Edit Python script
In this dialog, we may add some actions to make script more flexible.

Be careful to use "Clear Data", it will clear all data depends on your packagename.

Run Scripts

Add scripts
In this dialog, we may assign multi-scripts to run in the same cycle for auto-testing.
Press "Run Script" to perform auto-testing!

At the end, GogoMonkeyRun would compare the result for the latest run Result
This result would show comparison if developers are not aware to make a logical mistake while debuging code.


This Project is Completely Open Source.
If you have any idea, modifying the project and making pull request is welcome.

Contact me with my email:
pochihuang@gogolook.com or spring60569@gmail.com

Clone this wiki locally