Questions tagged [monkeyrunner]

Monkeyrunner is tool from Android SDK which provides an API for writing programs that control an Android device or emulator from outside of Android code.

Monkeyrunner is a host side application to control a monkey instance on a device.
Monkeyrunner provides some useful helper functions to control the device as well as various other methods to help script tests.

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.

476 questions
0
votes
0 answers

Syntax Error using monkeyrunner and python script

I'm trying to write a python script and run it through monkeyrunner. The script should automatically hit buttons in an android application at certain times. When running this script through CMD (I'm using Windows): Run in CMD: monkeyrunner…
ad01
  • 43
  • 1
  • 10
0
votes
0 answers

How can I get cobertura code coverage for Android MonkeyRunner tests?

We have been able to get cobertura code coverage for robolectic, using the steps mentioned at https://github.com/stephanenicolas/Quality-Tools-for-Android. For UI Automation, we are using MonkeyRunner. We have Emma code coverage setup for…
user1819441
  • 127
  • 2
  • 12
0
votes
0 answers

Can't use viewclient.py in windows env

I want to executable monkeyrunner in windows env, but I get the error: from com.dtmilano.android.viewclient import ViewClient File…
0
votes
2 answers

Android, how to send email through adb shell?

I am using monkeyrunner to run some tests on Android devices. I have a python script in which I create contacts and I use this shell for that: device.shell("am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name…
renatoarg
  • 303
  • 4
  • 13
0
votes
1 answer

MonkeyRunner send "Action/Next" key

Using MonkeyRunner how can I send the "next/action" key? It's the one on the bottom right corner of the android keyboard. Most of the time it's the same action as "KEYCODE_ENTER" or "KEYCODE_TAB" but not always. I tried device.press('ACTION_DOWN',…
elbajo
  • 683
  • 2
  • 8
  • 17
0
votes
2 answers

How to simulate touch on Image Button using view client

can any one tell me how to simulate touch on Image Button using android view client python
user
  • 65
  • 1
  • 11
0
votes
2 answers

MonkeyRunner on Windows Command Line

How does Python (or MonkeyRunner) locate imported modules? I previously asked about an error I get when running a monkeyrunner script from Git Bash. I still haven't resolved the issue and decided to try running it from the Windows 7 command line. I…
Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
0
votes
1 answer

MonkeyDevice getViewIdList() throws NullPointerException

Problem: MonkeyDevice getViewIdList() throws NullPointerException How I got the error: # Retyped, not copied, excuse typos. $ monkeyrunner >>> from com.android.monkeyrunner import MonkeyDevice, MonkeyRunner >>> device =…
CatShoes
  • 3,613
  • 5
  • 29
  • 43
0
votes
0 answers

Monkeyrunner/Robotium touch the webview but cannot direct to new page

I've been using Robotium to test on several open source phonegap applications. Recently when I test for Wikipedia and TeamToy-Pocket. I find that Robotium would click on the webElement but will not redirect the screen (while manually click the…
Wei Yang
  • 895
  • 3
  • 15
  • 26
0
votes
1 answer

Android view client does not show id for some screens

I m using android view client to find id using the command "java -jar androidviewclient-3.0.0.jar dump",it is showing id for some screens but on some screens thre error is "UnicodeEncodeError: 'ascii' codec can't encode characters in position 58-60:…
0
votes
3 answers

How does Python (or MonkeyRunner) locate imported modules?

Update: Following @dtmilano's suggestion, I added import sys print(sys.path) to the beginning of my MonkeyRunner script. This results in ['e:/path/android-sdk/tools/lib/monkeyrunner.jar:e:\\path\\bbct\\android\\functional-tests',…
Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
0
votes
1 answer

Error: No module named dtmilano

I followed the steps mentioned in the below post: Can't get AndroidViewClient example code to run But im still getting error "No module named dtmilano" In my test.py file i have added the following lines…
Evan
  • 5
  • 5
0
votes
1 answer

How to set the specific android monkey test?

I want to do the frequent operations about the the camera. The frequent operations are consist of launching camera -> taking picture -> doing onBackPressed -> launching camera -> ... Is there a way to do this ?
Jerikc
  • 349
  • 1
  • 4
  • 12
0
votes
1 answer

When Activity loads completely with Monkeyrunner

My app has an activity which loads some images from server. So, naturally it takes some time to load the activity completely, as it is fetching images from server. I need to know when the activity loads completely from Monkeyrunner. And if it…
arefin
  • 365
  • 3
  • 17
0
votes
1 answer

MonkeyRunner "sleep" while a progress finish

I am about to automaticaly scan my device for malware files. I use MonkeyRunner to connect, start the Antimalware Software, and start the scan. Here some of the code I…