monkeyrunner

Read from stdin with monkeyrunner

核能气质少年 提交于 2021-01-28 05:53:41
问题 How do I read from stdin with monkeyrunner? I tried the following code. import sys print("type something") something = sys.stdin.readline() print(something) I also tried the following: print("type something") something = raw_input() print(something) In both cases the program prints "type something" but it does not respond after I type something. It seems i am making some silly mistake? 回答1: This seems to be a bug with Jython 2.5.3, the version that is included with MonkeyRunner. The issue

Android Monkey Runner Device Calls Hang but Work when Process Is Killed

走远了吗. 提交于 2020-12-12 10:25:14
问题 So for starters, I have a rather complex system that connects to a python web socket to fire off some various Android events. I was more or less given this system in working form on a Mac Mini. I have since ported it to Ubuntu 13.04 with some success. The problem I'm running into is with two python scripts I'm using to actually trigger these Android events. What I have are two .py files, run_wsh and performAction. Essentially run_wsh is connected to via a socket and told what events to fire.

Android Monkey Runner Device Calls Hang but Work when Process Is Killed

霸气de小男生 提交于 2020-12-12 10:25:06
问题 So for starters, I have a rather complex system that connects to a python web socket to fire off some various Android events. I was more or less given this system in working form on a Mac Mini. I have since ported it to Ubuntu 13.04 with some success. The problem I'm running into is with two python scripts I'm using to actually trigger these Android events. What I have are two .py files, run_wsh and performAction. Essentially run_wsh is connected to via a socket and told what events to fire.

【转】Android自动化测试之MonkeyRunner MonkeyDevice MonkeyImage API使用详解 脚本编写 脚本录制回放

半世苍凉 提交于 2020-03-28 15:44:44
【内容转自】:https://blog.csdn.net/qq_30993595/article/details/80872808 MonkeyRunner简介: monkeyrunner工具提供了一个API,用于编写从Android代码之外控制Android设备或模拟器的程序。 使用monkeyrunner,你可以编写一个Python程序,安装Android应用程序或测试包,运行它,向其发送击键,截取其用户界面,并在工作站上存储屏幕截图。 monkeyrunner工具主要用于测试功能/框架级别的应用程序和设备以及运行单元测试套件,但您可以将其用于其他目的。 Monkeyrunner工具为Android测试提供了以下独特功能: 多设备控制:monkeyrunner API可以在多个设备或仿真器上应用一个或多个测试套件。您可以物理连接所有设备或一次启动所有模拟器(或两者),以编程方式依次连接每个模拟器,然后运行一个或多个测试。您也可以以编程方式启动仿真器配置,运行一个或多个测试,然后关闭仿真器。 功能测试:monkeyrunner可以运行Android应用程序的自动化开始至结束测试。您可以使用按键或触摸事件提供输入值,并将结果视为截图。 回归测试: monkeyrunner可以通过运行应用程序并将其输出截图与一组已知正确的截图进行比较来测试应用程序的稳定性。 可扩展的自动化

Can't get AndroidViewClient example code to run

北城余情 提交于 2020-01-25 12:50:14
问题 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 test.py and test.py consists of: # Imports the monkeyrunner modules used by this program from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice # Connects to the current device, returning a MonkeyDevice object device = MonkeyRunner.waitForConnection(

Appium学习11:monkeyrunner简介

旧时模样 提交于 2020-01-22 01:52:35
monkeyrunner简介 MonkeyRunner工具是使用Jython(使用Java编程语言实现的Python)写出来的,它提供了多个API,通过monkeyrunner API 可以写一个Python的程序来模拟操作控制Android设备app,测试其稳定性并通过截屏可以方便地记录出现的问题。 官网介绍如下 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

How to use MonkeyDevice.instrument?

六月ゝ 毕业季﹏ 提交于 2020-01-15 08:57:10
问题 HI guys, I'm trying to run one of my test instrumentation from my MonkeyRunner script. Unfortunately I can't get it to work. I've tried calling MonkeyDevice.instrument with different variations of the parameters but had no luck. I've tried device = MonkeyRunner.waitForConnection() device.instrument("android.test.InstrumentationTestRunner") device.instrument("com.myTestPackage.myTestClass") device.instrument("com.myTestPackage/.myTestClass") device.instrument("myTestClass") None of these throw

Keyevent to click on Alert Dialog of Android screen

∥☆過路亽.° 提交于 2020-01-12 10:19:54
问题 Is there any way to simulate keyevent on "OK" or "CANCEL" buttons of Android dialogue box using adb commands? 回答1: One indirect way is:- adb shell uiautomator dump /data/view.xml adb shell cat /data/view.xml calculate OK button coordinates from the relative coordinates given in the xml file. Then do adb shell input tap <x> <y> Hope works. 回答2: Using AndroidViewClient/culebra you can simply do: run java -jar androidviewclient-2.3.25.jar culebra --verbose --verbose-comments --find-views-with

MonkeyRunner

左心房为你撑大大i 提交于 2020-01-11 00:01:24
MonkeyRunner一般步骤: 首先进入monkeyrunner: 0.进入sdk/tools,monkeyrunner 1.导包from com.android.monkeyrunner import MonkeyRunner 2.连接device=MonkeyRunner.waitForConnection() 如果有多个设备,首先命令行中运行adb devices 查看可连接的设备列表 device=MonkeyRunner.waitForConnection(6,’emulator-5554′) 参数1:超时时间,单位秒,浮点数,默认是无限期地等待。 参数2:指定的设备名称deviceid,默认为当前设备(手机优先,其次为模拟器)。 3. device.installPackage("xxx.apk") 如果已经安装了可以跳过.. 4.device.startActivity(component='包名/活动名') 另外,还可以使用python脚本写,将命令全部写在里面 #coding=utf-8 import sys,time,datetime,os from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage device=MonkeyRunner

MonkeyRunner及MonkeyRunner模块简介

谁说我不能喝 提交于 2020-01-10 09:54:13
●MonkeyRunner简介 MonkeyRunner:Android SDK中自带的一个黑盒测试工具,在PC端通过Android API控制设备的运行或者自动化测试的执行。支持Python脚本,可以实现Monkey无法实现的一些逻辑控制。 注意: 前一章面讲的Monkey是运行在abd shell中的、运行在设备上,MonkeyRunner是在PC端运行,通过PC端提供的API来执行自动化测试的。 ●MonkeyRunner API 3大模块组成 ·MonkeyRunner //通用的一些方法的模块 ·MonkeyDevice //控制设备和模拟器的模块 ·MonkeyImage //与屏幕图像相关的模块 官方文档: https://developer.android.com/studio/test/monkeyrunner/index.html 官网上说:MonkeyRunner是一个和Monkey没有关系的工具,虽然名称相似,是两个完全不同的工具。MonkeyRunner提供了一些在Android测试中独有的特性,包括多设备的控制、支持功能测试、支持回归测试、在脚本中支持对结果截屏、可扩展API。 ●MonkeyRunner模块的方法 ●MonkeyRunner各个模块中主要API的使用方法 首先在adt-bundle...\sdk\tools双击monkeyrunner