【发布时间】:2012-10-26 09:44:57
【问题描述】:
我正在尝试从 Eclipse (4.2) 运行 MonkeyRunner Android 测试工具。 我安装了 Eclipse PyDev 插件以及 Jython 2.5.1。 我的 PyDev 解释器设置为 Jython / 2.5。
我在 Eclipse 中用一个简单的 jython 文件创建了一个 Jython 项目:
# 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()
现在,当我从 Eclipse(项目 > 以 JythonProject 运行)启动它时,我收到以下异常:
Traceback (most recent call last):
File "C:\svnrepository\trunk\JythonProject\src\main.py", line 10, in <module>
device = MonkeyRunner.waitForConnection()
at com.android.monkeyrunner.MonkeyRunner.waitForConnection(MonkeyRunner.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
java.lang.NullPointerException: java.lang.NullPointerException
知道有什么问题吗?
【问题讨论】:
标签: android testing jython monkeyrunner