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

Why is MonkeyRunner failing with Bad type on operand error?

On Ubuntu 18.04, I installed MonkeyRunner via sudo apt install monkeyrunner, and it completed successfully. I created a file called test.py and wrote the content from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice I connected my phone…
Yanick Rochon
  • 51,409
  • 25
  • 133
  • 214
0
votes
1 answer

AndroidViewClient - How to get notified when the Android Virtual Device start process is completed?

I use AndroidViewClient in order to use MonkeyRunner through Python. I need to start the AVD programmatically and get notified when the AVD start process is completed. How can I catch that event? The execution just does not reach the line after the…
0
votes
2 answers

PyCharm - How to create a Run/Debug Configuration that executes a .bat file which uses a Python script as a parameter?

I want to create a new Run/Debug Configuration which executes a .bat file that accepts a Python script as a parameter. The program I want to execute is MonkeyRunner (a tool part of Android SDK) which is located in the…
talha06
  • 6,206
  • 21
  • 92
  • 147
0
votes
2 answers

Python - ImportError: No module named 'pymongo' despite pip says "requirement already satisfied" [Windows]

As the title clearly describes, despite I have successfully installed PyMongo thru the suggested way (executing the command python -m pip install pymongo), getting an error like ImportError: No module named 'pymongo' when I try to execute a Python…
talha06
  • 6,206
  • 21
  • 92
  • 147
0
votes
1 answer

Monkeyrunner. Connect to multiple devices at the same time

I used this script to connect to multiple Android devices at the same time (i.e. to send files via adb): from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice import time import sys import time import os devices = os.popen('adb…
M.H.
  • 1
  • 1
0
votes
1 answer

Execute Gradle Task for Testing before Android (testing) build

i have a Gradle Task that executes a monkeyrunner script for me. I need to add this task to the normal build process for testing. Inside the script i grant some permissions that are mandatory for testing and the testing output. I can't figure out…
0
votes
1 answer

Avoiding MonkeyRunner.sleep

I'm completely new to monkeyrunner and Android development in general. Following a bogstandard monkeyrunner tutorial, I was advised by someone to also perform the following sleep call after startActivity: runComponent = package + '/' + activity #…
Mayakovsky
  • 3
  • 1
  • 2
0
votes
2 answers

How can I send commands to Android Emulator using Monkeyrunner?

I have an application with a login, what I want to do is lunch de application and then interact with the app, sending the username and password. What is wrong with this script? # Imports the monkeyrunner modules used by this program from…
Punkyrol77
  • 21
  • 1
  • 6
0
votes
1 answer

monkeyrunner can't be started up with an error

I met an error of SWT folder '..\framework\x86_64' does not exist. Please set ANDROID_SWT to point to the folder containing swt.jar for your platform. when i run the monkeyrunner in the first time.By the way, the sdk is installed with the…
SF_King
  • 3
  • 3
0
votes
1 answer

monkeyrunner Running getChildren() on view will cause "Node with given ID does not exist exception"

I have nav drawer with "Settings" as TextView without an ID. I can get the home_nav_view but when trying to iterate over the children I get the exception "com.android.chimpchat.core.ChimpException: Node with given ID does not exist" Am I doing…
Tzach Solomon
  • 688
  • 8
  • 27
0
votes
0 answers

EasyMonkeyDevice touch sometimes tap on wrong coordinates

My program is trying to establish a VPN connection, thus, I get the Android message about "Connection Request - your software wants to setup a VPN connection ... Only accept if you trust the source". From uiautomationviewer I saw the ID is…
Tzach Solomon
  • 688
  • 8
  • 27
0
votes
1 answer

Does Monkey Runner need any Scripting language to Run

Does Monkey Runner needs any Scripting language to Run , actually my question is Monkey runner Only Click the UI of the App, Here i need to Check where my app getting crash?
Fouziya Hanif
  • 21
  • 1
  • 6
0
votes
1 answer

starting monkeyrunner but only jyphon starts

please can someone help i have not done this for a while. I am trying to execute a monkeyrunner python script. In my c:\Android\sdk\tools\bin directory i run the following: monkeyrunner monkeyRun.py. Nothing happen only jython command line starts
the_big_blackbox
  • 1,056
  • 2
  • 15
  • 35
0
votes
1 answer

How to create a different process while AndroidTest runs?

I'm working to setup my test infrastructure on an Android app. I'm using Android Studio, gradle, Espresso, MonkeyRunner, emulators, and real devices. I run AndroidTest using gradlew connectedAndroidTest. In setting up proper test fixtures, I'm…
0
votes
1 answer

Android MonkeyRunner doesn't start

Hey, im trying to start the Monkeyrunner-Example-Project with my App. When he trys to install the apk, it returns this error: device.installPackage-> 101208 13:43:52.900:S [pool-1-thread-1] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Error…