monkeyrunner

monkeyrunner and EndCall

孤人 提交于 2019-12-08 03:47:05
问题 I'm using MonkeyRunner to play with simulation of user activity. All fine but I cannot press EndCall. To make call I use: device.touch(190, 800, 'DOWN_AND_UP') x,y coordinates of CALL button. But when I trying to hangup I try : device.touch(230, 700, 'DOWN_AND_UP') x,y - accordingly coordinates of End Call button. Nothing happen.Trying press: device.press('KEYCODE_ENDCALL', 'DOWN_AND_UP') Same effect. Trying now to send intent but dont know which intent to use to EndCall. My device running on

Issues using monkeyrunner startActivity

蹲街弑〆低调 提交于 2019-12-07 20:32:02
问题 I have read several posts online, including Android dev website http://developer.android.com/tools/help/monkeyrunner_concepts.html I can't start an Activity through the startActivity method. I have tried several options. Here's an example code: package = 'com.mydomain.mypackage' activity = '.MyActivity' runComponent = package + '/' + activity device.startActivity(component=runComponent) Also tried the following code: package = 'com.mydomain.mypackage' activity = 'com.mydomain.mypackage

cannot use raw_input if monkeyrunner is included in python script

寵の児 提交于 2019-12-07 18:08:55
问题 I want to input some values in my python script. Part of my code is: import os,sys,subprocess,shlex,time from com.android.monkeyrunner import MonkeyRunner import com.android.monkeyrunner.MonkeyDevice from com.android.monkeyrunner.recorder import MonkeyRecorder as recorder user = raw_input("enter your username") print user When i am executing the code as "monkeyrunner camautoopen.py" Then i can only input username. But i cannot print it. when my code is : import os,sys,subprocess,shlex,time

Why the MonkeyRunner.waitForConnection() doesn't work in my environment?

[亡魂溺海] 提交于 2019-12-07 11:56:53
问题 Script: from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice device = MonkeyRunner.waitForConnection(5,'192.168.6.60:5555') device.installPackage('Douban_Radio.apk') Before it runs: ~/android-sdk-linux_86/tools$adb connect 192.168.6.60:5555 connected to 192.168.6.60:5555 ~/android-sdk-linux_86/tools$adb devices List of devices attached 192.168.6.60:5555 device The output of monkeyrunner: ~/android-sdk-linux_86/tools$./monkeyrunner monkeyrunnerTest.py 110412 18:12:35.017:S [main]

How to click a view of android program through MonkeyRunner?

这一生的挚爱 提交于 2019-12-06 22:46:56
问题 I want to use MonkeyRunner to test the compatibility of my android program for a list of devices with different screen resolutions. I need to click a view, but the view is not in the same position for different resolutions. How can I get the position of it or do something else to click it? NEED your help! 回答1: I know it's a little late, but you can use hierarchyviewer in android sdk to get the view id. Then, in your script, use this: from com.android.monkeyrunner import MonkeyRunner,

Why does MonkeyRunner.waitForConnection() error “Adb rejected adb port forwarding command: cannot bind socket”

末鹿安然 提交于 2019-12-06 16:30:53
When I try to get a device with MonkeyRunner I get this message: newdevice = MonkeyRunner.waitForConnection() 110804 17:35:28.561:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice] Adb rejected adb port forwarding command: cannot bind socket 110804 17:35:28.561:S [main] [com.android.monkeyrunner.adb.AdbMonkeyDevice]com.android.ddmlib.AdbCommandRejectedException: cannot bind socket I'm running monkeyrunner.bat from the commandline in windows Xp with JDK 1.6.0_26, Python 2.7.2, and Android SDK 11. adb devices shows my USB device. I also had come across this problem but killing and

How does Python (or MonkeyRunner) locate imported modules?

∥☆過路亽.° 提交于 2019-12-06 16:29:41
问题 Update: Following @dtmilano's suggestion, I added import sys print(sys.path) to the beginning of my MonkeyRunner script. This results in ['e:/path/android-sdk/tools/lib/monkeyrunner.jar:e:\\path\\bbct\\android\\functional-tests', 'E:\\path\\android-sdk\\tools\\lib\\Lib', '/E:/path/android-sdk/tools/lib/jython-standalone-2.5.3.jar/Lib', '__classpath__', '__pyclasspath__/'] At first glance I thought this included the current working directory. However, a closer inspection showed that the output

monkeyrunner录制和回放功能

偶尔善良 提交于 2019-12-06 13:52:42
脚本录制 网上先是搜索了一下,说是SDK--tools目录下有monkey_recorder.py和monkey_playback.py的脚本,但是我的没有找到所以可以自己编辑个脚本保存即可~ 先编辑以下代码为monkey_recorder.py,保存在tools中 from com.android.monkeyrunner import MonkeyRunner as mr from com.android.monkeyrunner.recorder import MonkeyRecorder as recorder device = mr.waitForConnection() recorder.start(device) 这个是回放的代码monkey_playback.py #!/usr/bin/env monkeyrunner # Copyright 2010, The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at

Issues using monkeyrunner startActivity

徘徊边缘 提交于 2019-12-06 08:52:02
I have read several posts online, including Android dev website http://developer.android.com/tools/help/monkeyrunner_concepts.html I can't start an Activity through the startActivity method. I have tried several options. Here's an example code: package = 'com.mydomain.mypackage' activity = '.MyActivity' runComponent = package + '/' + activity device.startActivity(component=runComponent) Also tried the following code: package = 'com.mydomain.mypackage' activity = 'com.mydomain.mypackage.MyActivity' runComponent = package + '/' + activity device.startActivity(component=runComponent) But, nothing

Appium自动化测试教程-自学网-monkeyrunner API

蓝咒 提交于 2019-12-06 03:20:41
MonkeyRunner API MonkeyRunner工具主要有三个类: MonkeyRunner MonkeyDevice MonkeyImage 官方 API文档 : http://www.android-doc.com/tools/help/monkeyrunner_concepts.html# 1.MonkeyRunner类: MonkeyRunner提供连接真机和模拟器、输入、暂停、警告框等方法。 常用方法 waitForConnection(float timeout,string deviceid), from com.android.monkeyrunner import MonkeyRunner as mr print("connect devices...") device=mr.waitForConnection() # device=mr.waitForConnection(5,'127.0.0.1:62001') 2.MonkeyDevice类 MonkeyDevice类提供了安装和卸载程序包、开启Activity、发送按键和点击事件、运行测试包等方法。 常用方法 installPackage (string path) removePackage (string package) startActivity (string uri, string