51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3131|回复: 8
打印 上一主题 下一主题

【求教】MonkeyRecorder显示空白

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2016-10-20 15:21:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
最近在学习monkeyrunner,想用MonkeyRecorder获取APP控件坐标(连接真机),但启动MonkeyRecorder后报错且显示空白(见截图),有人知道什么原因吗?
《MonkeyRecorder.py》代码如下:
from com.android.monkeyrunner import MonkeyRunner as mr
from com.android.monkeyrunner.recorder import MonkeyRecorder as recorder
device = mr.waitForConnection(1,'设备号')
recorder.start(device)


报错信息(第一部分,第二部分在楼下):
E:\sdk>monkeyrunner G:\AutoTest\MonkeyRecorder.py
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce] Unable to take snapshot
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]com.android.ddmlib.TimeoutException
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at com.android.ddmlib.AdbHelper.read(AdbHelper.java:686)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at com.android.ddmlib.AdbHelper.read(AdbHelper.java:654)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:327)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at com.android.ddmlib.Device.getScreenshot(Device.java:558)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at com.android.chimpchat.adb.AdbChimpDevice.takeSnapshot(AdbChimpDevice.
java:209)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at com.android.monkeyrunner.recorder.MonkeyRecorderFrame.refreshDisplay(
MonkeyRecorderFrame.java:115)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at com.android.monkeyrunner.recorder.MonkeyRecorderFrame.access$000(Monk
eyRecorderFrame.java:60)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at com.android.monkeyrunner.recorder.MonkeyRecorderFrame$2.run(MonkeyRec
orderFrame.java:109)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventQueue.access$200(EventQueue.java:103)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventQueue$3.run(EventQueue.java:682)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventQueue$3.run(EventQueue.java:680)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.security.AccessController.doPrivileged(Native Method)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDo
main.java:76)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:242)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:161)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:150)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
161020 14:46:14.792:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at com.android.monkeyrunner.recorder.MonkeyRecorderFrame.refreshDisplay(
MonkeyRecorderFrame.java:116)
        at com.android.monkeyrunner.recorder.MonkeyRecorderFrame.access$000(Monk
eyRecorderFrame.java:60)
        at com.android.monkeyrunner.recorder.MonkeyRecorderFrame$2.run(MonkeyRec
orderFrame.java:109)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
        at java.awt.EventQueue.access$200(EventQueue.java:103)
        at java.awt.EventQueue$3.run(EventQueue.java:682)
        at java.awt.EventQueue$3.run(EventQueue.java:680)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDo
main.java:76)



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2016-10-20 15:22:34 | 只看该作者
报错信息第二部分:
161020 14:46:19.863:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
161020 14:46:19.863:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:242)
161020 14:46:19.863:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:161)
161020 14:46:19.863:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:150)
161020 14:46:19.863:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)

161020 14:46:19.863:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)

161020 14:46:19.863:S [AWT-EventQueue-0] [com.android.chimpchat.adb.AdbChimpDevi
ce]     at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at com.android.monkeyrunner.recorder.MonkeyRecorderFrame.refreshDisplay(
MonkeyRecorderFrame.java:116)
        at com.android.monkeyrunner.recorder.MonkeyRecorderFrame.access$000(Monk
eyRecorderFrame.java:60)
        at com.android.monkeyrunner.recorder.MonkeyRecorderFrame$1.actionPerform
ed(MonkeyRecorderFrame.java:89)
        at javax.swing.Timer.fireActionPerformed(Timer.java:312)
        at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
        at java.awt.EventQueue.access$200(EventQueue.java:103)
        at java.awt.EventQueue$3.run(EventQueue.java:682)
        at java.awt.EventQueue$3.run(EventQueue.java:680)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDo
main.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:242)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:161)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:150)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
回复 支持 反对

使用道具 举报

  • TA的每日心情

    2024-7-8 09:00
  • 签到天数: 943 天

    连续签到: 1 天

    [LV.10]测试总司令

    3#
    发表于 2016-10-20 15:46:26 | 只看该作者
    连接ANDROID设备了么
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    4#
     楼主| 发表于 2016-10-20 16:06:58 | 只看该作者
    梦想家 发表于 2016-10-20 15:46
    连接ANDROID设备了么

    连接了。
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    5#
    发表于 2016-10-31 17:58:41 | 只看该作者
    世上没有绝望的处境,只有对处境绝望的人。
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    6#
    发表于 2018-11-28 16:51:31 | 只看该作者
    遇到同样的问题,请问大佬解决了没,求教
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    7#
    发表于 2018-11-28 16:52:16 | 只看该作者
    遇到同样的问题,请问大佬解决了没,求教
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    8#
    发表于 2020-9-14 18:03:57 | 只看该作者
    device = mr.waitForConnection(1,'设备号')
    这里要填具体的设备号,可以用adb devices命令查看
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-24 06:22 , Processed in 0.073081 second(s), 24 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表