monkeyrunner

How to use monkey and monkeyrunner tools for android testing?

吃可爱长大的小学妹 提交于 2019-12-03 12:12:51
How do you use monkey and monkeyrunner tools for android testing? What are the basic commands needed? adb shell monkey -p com.bla.yourpackage -v 1000 First is your package that you want monkey to run in and be restricted to. Second is i verbose mode, third is number of events to run. You can find out more by doing adb shell monkey -help einverne Here are some useful tips when using monkey test. Specify one activity Add category in manifest: <activity android:name="MonkeyActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent

How can I make a Java app using the Monkeyrunner API?

两盒软妹~` 提交于 2019-12-03 05:44:55
The Android SDK has an API for sending commands to the phone called Monkeyrunner. It appears to be a Python API. Is there anyway I can use it in a Java application? Well I have been trying to do this, here is what I found (Thanks to google and some help from members on the internet) Here is a little Java program that uses monkeyrunner to print the name of the device import com.android.monkeyrunner.MonkeyDevice; import com.android.monkeyrunner.adb.AdbBackend; public class Monk { public static void main(String[] args) { // TODO code application logic here Monk monk=new Monk(); monk.demo(); }

Setup MonkeyRunner on Android

家住魔仙堡 提交于 2019-12-01 19:49:17
I'd like to use MonkeyRunner. I've got a monkeyrunner.jar and import it into my project. How can I use it now? Could you tell me what should I do step-by-step. I've seen some code snippet on python, but I don't understand how can I use python in eclipse. Maybe this link can help you how to use monkeyrunner in eclipse: http://fclef.wordpress.com/2011/11/24/using-android-monkeyrunner-from-eclipse-in-windows/ 来源: https://stackoverflow.com/questions/7556037/setup-monkeyrunner-on-android

Trying to run simple monkeyrunner python script, 'importerror no module named os'

青春壹個敷衍的年華 提交于 2019-12-01 11:10:32
I have the android emulator/SDK installed on my computer, and I'm trying to run a simple python script, but it fails on the 'import os' line (which should be standard!) Here's my script: import os print os.environ['PATH'] works fine when I run it against the actual python executable as python test.py but when I do monkeyrunner.bat test.py I get the error listed in the title of this question. I've uninstalled/reinstalled python several times, with no luck. Tried adding a PYTHONPATH ENV varaible, no luck. Set the python install dir to be in the PATH ENV variable. Kind of at my wits end, I think

What exactly is a monkey doing messing with my Android phone?

只谈情不闲聊 提交于 2019-11-30 17:41:22
Looking through the Android apis I found a method call isUserAMonkey() , says it returns true if the phone is being messed with by a monkey. Is this a joke, or what is it used for? Gallal Look at monkeyrunner , it will give you the answer. Quote from the document: 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

What exactly is a monkey doing messing with my Android phone?

蓝咒 提交于 2019-11-30 01:12:00
问题 Looking through the Android apis I found a method call isUserAMonkey(), says it returns true if the phone is being messed with by a monkey. Is this a joke, or what is it used for? 回答1: Look at monkeyrunner, it will give you the answer. Quote from the document: 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,

Android monkey runner: Touch with MOVE

自闭症网瘾萝莉.ら 提交于 2019-11-29 12:27:31
I am trying to use monkeyrunner to simulate complex touch events. A swipe from a to b with... device.drag((300,500),(300,650),0.5,50) works great but a complex movement from a to b to c doesn't work trying with that device.touch(100,500, 'DOWN') device.touch(300,500, 'MOVE') device.touch(300,400, 'MOVE') device.touch(300,400, 'UP') Was seaching for a solution and found this.. https://android-review.googlesource.com/#/c/50991/ Is this already implemenet in the offical android sdk? or did i have to compile it or something else and how it works? I dont really know but i think this side is the

Monkeyrunner点击方法

旧街凉风 提交于 2019-11-28 19:39:33
安卓自动化测试工具MonkeyRunner之使用ID:http://www.51testing.com/html/30/n-848530.html Monkeyrunner学习之三(如何使用坐标去点击的方法) :http://blog.csdn.net/lin_feng_912/article/details/23205085 Android自动化测试之Monkeyrunner解决ID重复问题 http://blog.csdn.net/testing_is_believing/article/details/16369639 monkeyrunner 用id点击 Monkeyrunner 几个问题的解决方案:http://www.51testing.com/html/47/47-810274.html 来源: oschina 链接: https://my.oschina.net/u/855532/blog/406121

Can a specified message or row be cleared in the adb logcat instead of clearing all?

微笑、不失礼 提交于 2019-11-28 02:17:52
I am using Monkeyrunner (automation) to test an app on an Android device (Samsung S2), and since it does not allow me to see image patterns on the screen, I have to rely on the adb logcat (using Windows) to look for specific messages in order to know when the next page has loaded for my automation script. And in order to look for specific (unique) messages in the logcat, for my monkeyrunner script, I have to CLEAR out ALL the adb logs, then perform the search. Is there a way to clear out only the line(s) that match a specific tag, message, text, or whatever(!), within the logcat log? Instead

Monkeyrunner自动化测试由浅入深(第一节)

自闭症网瘾萝莉.ら 提交于 2019-11-27 18:53:36
(原版)Monkeyrunner自动化测试由浅入深(第一节) 博主原创,请勿转载 第一、相关软件和环境的配置 1、Android sdk下载和配置 2、java jdk下载和配置 第二、Monkeyrunner认识 Monkeyrunner是Android SDK中提供的一个测试工具,存放位置在SDK-tools中,以bat文件存在,即monkeyrunner.bat,双击此文件即启动monkeyrunner(启动是不是很简单,小编之前还以为monkeyrunner是需要何等高级配置) 官方定义(官方地址: http://developer.android.com/tools/help/MonkeyDevice.html ):monkeyrunner工具,其本身提供了一个API来供大家编程啦,用以控制一个android设备或者模拟器,而不用了解这个android及其应用的源码。有了monkeyrunner,我们可以写一个Python(monkeyrunner指定脚本语言,不会没关系,继续看)的程序来安装android程序或者测试包,运行编写好的脚步语言,则通过monkeyrunner则会给模拟器或者真机发送一系列控制事件,并且测试的过程中,还可以自定义重要步骤的截图(代码自动完成)。monkeyrunner的工具的作用是在功能/框架层上测试应用和设备,跑单元测试用例