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
1 answer

MonkeyRunner cannot run on Git Shell. Receiving @echo: command not found

I am trying to run Android's MonkeyRunner but having problems running it from my Git Shell. When I run: monkeyrunner.bat it gives me this error. $ monkeyrunner.bat /c/AndroidSDK/tools/monkeyrunner.bat: line 1: @echo: command not…
The Nomad
  • 7,155
  • 14
  • 65
  • 100
0
votes
1 answer

Will an existing script of MonkeyRunner works if the screen layout changes?

will an existing script of MonkeyRunner works if the screen layout changes ? e.g. screen toggles potrait to landscape mode, or , variation in screen size between multiple devices etc.
Chirag Dhyani
  • 863
  • 11
  • 24
0
votes
1 answer

Saving Monkeyrunner captured screenshot to internal storage?

Is there any way of saving the screenshot taken by MonkeyRunner's device.takeSnapshot() to the phone's internal storage itself? This example I have seen on the net only saves it to the computer where the MonkeyRunner command is…
0
votes
2 answers

Android Monkeyrunner plugin for Wifi state

I am trying to write a java plugin for the Android Monkeyrunner to check the WiFi state. I would like to use the Android API WiFiManager to get the current WiFi state and return it back. The error message in Eclipse is: The method getWifiState() is…
Empario
  • 402
  • 6
  • 19
0
votes
1 answer

Python - turn off wifi with MonkeyRunner

The following Python script will be run with MonkeyRunner: from com.android.monkeyrunner import MonkeyDevice, MonkeyRunner, MonkeyView, MonkeyImage my_device = MonkeyRunner.waitForConnection() activity =…
Empario
  • 402
  • 6
  • 19
0
votes
2 answers

Capture the layout of all screens - Android App

I want to test android apps for accessibility violation. Is it possible to use uiautomator api and monkeyrunner api to capture the layout of all screens?
Arjun
  • 25
  • 4
0
votes
2 answers

How to select all text in a text field in monkeyrunner?

Actually I want to delete all text in a text field, and I am using a loop calling device.press('KEYCODE_DEL') to achieve this. But there are two disadvantages: Not efficient enough, especially when I don't know how many characters in the text field…
WKPlus
  • 6,955
  • 2
  • 35
  • 53
0
votes
1 answer

unresolved import:monkeyrunner using monkeyrunner interpreter

I am getting the error message using monkeyrunner interpreter, but the code runs absolutely fine. I have imported all correct PYTHONPATH and I am on mac machine and using eclipse Luna. unresolved import:monkeyrunner this is a very simple code, it…
user2511126
  • 620
  • 1
  • 14
  • 31
0
votes
1 answer

How to integrate monkeyrunner integration testing with emma coverage testing?

I have created an android app and I'd like to analyze the code coverage of integration tests. Assuming the activities as units, I have tested the interaction between some activities (with monkeyrunner) so as to validate some scenarios of my app's…
Dev
  • 1
  • 1
0
votes
1 answer

AndroidViewClient: giving import error

I’ve downloaded from git the latest version AndroidViewClient. I did the easy_install method but I get ~/projects/AndroidViewClient-master/AndroidViewClient $ monkey runner examples/check-import.py 141022 11:55:48.708:S [main]…
0
votes
1 answer

How to shift time forward on avd (android emulator) via monkeyrunner script?

I need to change time on my AVD without stopping script. Task: launch apk take screenshot-1 shift time forward on N hours (maybe days) launch browser take screenshot-2 Compare two screenshots How to change time on emulator? can't find…
0
votes
1 answer

Android - ADB/MonkeyRunner Setting API Levels

I've downloaded an APK onto a Velocity Cruz Tablet running Android 2.2.1 (API Level 8), and I'm trying to install it via whatever I can manage to make work. I already had ADT on my computer (Windows 8.1 if this helps) for API Level 19 for use with…
0
votes
2 answers

Android ChimpChat throws exception

I am trying to get chimpchat to work for Android. This is my class import java.util.Map; import java.util.TreeMap; import com.android.chimpchat.ChimpChat; import com.android.chimpchat.adb.AdbBackend; import…
AnujKapoor
  • 99
  • 2
  • 10
0
votes
2 answers

Monkeyrunner: How do you access elements using their relative position instead of absolute co-ordinates?

I want to automate testing of an android app, and monkeyrunner is a tool I am considering using as it works with python (I haven't learned java). I have automated desktop webpage testing using Selenium WebDriver before and that allowed me to access…
user3873725
  • 67
  • 1
  • 4
0
votes
1 answer

adb or monkeyrunner? Which is more stable?

I'm using National Instruments Teststand to set up some sequences for automating an android device. I'm using a combination of direct adb.exe calls, and monkeyrunner calls to .py scripts. When I am settin up a sequence to say automate some touch…