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

Android.isUserAMonkey throws RuntimeException

I'm seeing exceptions when ActivityManager.isUserAMonkey() is run on older Android devices: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.AndroidApp}: java.lang.RuntimeException: Unknown exception code: 1 msg null …
P.T.
  • 24,557
  • 7
  • 64
  • 95
0
votes
1 answer

how to select an option from "attach" in message application using monkey runner

I am trying to automate sending of MMS using a monkey runner script which is a python script.I am getting the co-ordinates from hierarchy viewer for touch/press functions.But the problem is all these events work on the main screen.I mean if there is…
0
votes
1 answer

How to toggle bluetooth using androidviewclient

I am trying to toggle Bluetooth using AndroidviewClient. Below is part of the code. I am able to "find Bluetooth" and get the id and text also. Then I want to get get the view for ON/OFF to toggle. When I print in the below for loop, I get 3 views…
0
votes
2 answers

Python class to inherit MonkeyDevice

I followed the solution as given here and added a method to extend functionality to my Device class. How to inherit from MonkeyDevice? I get an error object has no attribute 'test'. Looks like my Class instance is of type MonkeyDevice. What am I…
0
votes
1 answer

MonkeyRunner/AndroidViewClient basic script not working

I have a pretty basic script where I intend for the application to drag 3 times, and then touch a button. The application drags three times perfectly, but then get's an error when I add in the touch code. Code: device, serialno =…
EGHDK
  • 17,818
  • 45
  • 129
  • 204
0
votes
1 answer

AndroidViewClient ERROR: Device is secure

I'm trying to use AndroidViewClient for some automation. On [github][1] there is a page about "Secure Mode". It states this: AndroidViewClient has two possible back-ends: ViewServer UiAutomator UiAutomator works on Android API 16 and higher, so if…
EGHDK
  • 17,818
  • 45
  • 129
  • 204
0
votes
2 answers

Can't get AndroidViewClient example code to run

AndroidViewClient is a github repo that allows you to call on views directly, without specifying exact coordinates with monkeyrunner. I'm having trouble actually using it though. Note: I'm using Windows In cmdline if I type: monkeyrunner…
EGHDK
  • 17,818
  • 45
  • 129
  • 204
0
votes
1 answer

MonkeyRunner and MySQL

I got a problem using MySQL with MonkeyRunner, need a help with MySQL Driver Name. The starting of my script is: #coding : utf-8 from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice from com.ziclix.python.sql import zxJDBC db =…
Angry-d
  • 87
  • 1
  • 2
  • 12
0
votes
1 answer

Can I use Monkeyrunner for testing my own APIs?

I have an application, which is written on top of Android, and it uses BT, WiFi, NFC APIS from Android. This application will expose some APIs, which other users can use to create their own apps.But before exposing the APIs, I want to test them.Can…
0
votes
2 answers

Browser Activity not working

I need to launch the browser in the device. The android version is 4.1 The line below isn't working, It's written in monkeyrunner device.startActivity( component='com.google.android.browser/.BrowserActivity', uri=url)
srh snl
  • 797
  • 1
  • 19
  • 42
0
votes
2 answers

Get current CPU usage in monkeyrunner script

I am using a monkeyrunner Jython script to automate some UI test. I want to confirm that the previous step is complete before doing the next step, based on the current CPU usage of the OS (of the PC the emulator is running on). Hence I need a way to…
Jiechao Wang
  • 922
  • 1
  • 15
  • 32
0
votes
2 answers

Disabling long press in MonkeyRunner

I am using the MonkeyRunner Drag functionality, which always does long presses instead of Drag events. Is it possible to disable long press? Is there any other solution for this?
0
votes
1 answer

Trouble with findViewByIdOrRaise in AndroidViewClient

Trying to use MonkeyRunner to perform some testing and want to use AndroidViewClient to work with EditText widgets. I believe I am using AndroidViewClient correctly (relevant stuff below), findViewByIdOrRaise() is always throwing an error. I've…
CatShoes
  • 3,613
  • 5
  • 29
  • 43
0
votes
0 answers

How to restart monkeyrunner connection?

Im having problems with my monkeyrunner. The first run will work but the succeeding wont. It will just hang and say "Monkeyrunner wake command" I am thinking that restarting the connection might fix the issue. Is there any way to restart the…
srh snl
  • 797
  • 1
  • 19
  • 42
0
votes
1 answer

monkeyrunner hangs when making a connection to the device

Here's what I need to do. I have 2 devices which I need to test using monkeyrunner. It is an automated test using python and monkeyrunner. I want to execute the test simultaneously for the 2 devices so I thought of using thread. here's the…
srh snl
  • 797
  • 1
  • 19
  • 42