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
6
votes
2 answers

How to Flick using monkeyrunner? not just Drag

I am trying to automatically scroll the browser using monkeyrunner. So far I can scroll by "Drag" event, but how can I scroll by "Flick". I appreciate if you can give me some hits or instructions. Using drag: for i in range(1, 40): …
quiel
  • 427
  • 1
  • 3
  • 19
6
votes
1 answer

How can I pass an Extra to an Android intent using MonkeyRunner?

I am trying to test my app using the MonkeyRunner tool. I am trying to add an EXTRA to my activity. The python script executes without error: device = MonkeyRunner.waitForConnection() device.wake() extra = {'MY_EXTRA',…
brendan
  • 29,308
  • 20
  • 68
  • 109
6
votes
3 answers

Monkeyrunner doesn't touch webview

I need to test android app which includes WebView with buttons. Monkeyrunner works fine for all parts of the app except WebView. Button in WebView just ignores touches from Monkeyrunner. I see that button is clicked because it became grey but then…
Alex
  • 4,457
  • 2
  • 20
  • 59
6
votes
4 answers

How to do UI automation in android?

Is there any guide to do following UI automation like selecting an item, writing text, pressing buttons in Android. Please list the steps to integrated this UI automation of one of the above thing. Thanks
blackfyre
  • 2,549
  • 5
  • 39
  • 58
6
votes
2 answers

How do I catch SocketExceptions in MonkeyRunner?

When using MonkeyRunner, every so often I get an error like: 120830 18:39:32.755:S [MainThread] [com.android.chimpchat.adb.AdbChimpDevice] Unable to get variable: display.density 120830 18:39:32.755:S [MainThread]…
Dean
  • 8,632
  • 6
  • 45
  • 61
5
votes
2 answers

How to run Monkeyrunner script on multiple devices at the same time

I am trying to run a monkeyrunner script on multiple devices to do some basic operations.I figured out that initialy I will start of writing a script to perform basic action in two connected devices. from com.android.monkeyrunner import…
Elsa Adams
  • 171
  • 1
  • 3
5
votes
2 answers

Send non english-text using adb (input keyevent) or using monkeyrunner

I would like to send some non-english text to an Android device. I have been trying both the monkeyrunner type command and adb shell command (input keyevent ...), with no success. Please help.
user1137160
  • 61
  • 1
  • 3
5
votes
1 answer

takeSnapshot() error of monkeyrunner

I am testing monkeyrunner and using below .py file for screencapture. screencapture image is generated but sometimes it occurs error in "resulet = device.takeSnapshot()" I don't know what's the problem. I have tested it with Eclipse. (Eclipse -> AVD…
국원 김
  • 51
  • 1
  • 2
5
votes
2 answers

Do you know any dynamic instrumentation tool for Android with multi-device support (ideally in Python or Jython)?

For my CI infrastrucure I need to automatically deploy and run complex tests between two (or more) android phones from a controler machine (linux). So far android monkeyrunner in combination with android unit tests is not a satisfactory…
5
votes
4 answers

What's the 3rd argument of monkeyrunner.press

After SDK tool upgrade to revision 12, When I connect to monkeyrunner and use press method like device.press('KEYCODE_HOME','DOWN') Will get error msg Traceback(most recent call last): File "", line 1, in TypeError:press:The 3rd argument is…
Nancy
  • 51
  • 2
5
votes
1 answer

Adding a contact via adb or monkeyrunner

Does anyone know if there is a way to add a contact via adb or monkeyrunner? Using device.shell("am start -a android.intent.action.ACTION_INSERT -t ContactsContract.Contacts.CONTENT_TYPE -e ContactsContract.Intents.Insert.NAME "+name+"…
n8schloss
  • 2,723
  • 2
  • 19
  • 27
5
votes
1 answer

Running Monkeyrunner from pydev

Hi I want to run python scripts developed from Monkeyrunner in Eclips-Pydev setup. I have installed Jython and mapped the Jython interpreter and added the Monkeyrunner.jar to Pydev also. But still I'm not able to import com.android.monkeyrunner…
ram
  • 51
  • 3
5
votes
2 answers

While True python script should loop infinite but it only executes once - Monkeyrunner

I created simple python script to do infinite loop to test my android app, however it only runs through succesfully once and stops. # Imports the monkeyrunner modules used by this program from com.android.monkeyrunner import MonkeyRunner,…
5
votes
0 answers

How to record touches and emulate them later on real devices (with ROOT if needed)?

Background the monkeyRunner (and monkey) is a nice tool to test out apps. I have an idea of using it (or something similar) to record & emulate touches (and keys). The problem The tool itself has some disadvantages: needs to be run on an emulator…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
5
votes
2 answers

Keyevent to click on Alert Dialog of Android screen

Is there any way to simulate keyevent on "OK" or "CANCEL" buttons of Android dialogue box using adb commands?
Fresher
  • 269
  • 5
  • 16
1
2
3
31 32