android uiautomator runtest错误没找到类 [英] android uiautomator runtest error didn't find class
问题描述
最近我尝试开始使用android uiautomation测试。
recent i tryied getting started with android uiautomation testing.
来自开发者网站的教程我经历了几次并且在遇到一些问题并解决它们之后现在我有一个更大的问题。
The tutorial from the developer site I've worked through a few times and after having some problems and solving them now I have got a bigger issue.
我创建了一个项目,导入了两个jar文件并构建了一个java测试用例场景(教程中的那个)。
之后我用shell命令行创建了一个uitest projekt。更新了build.xml创建了一个jar文件并将其推送到我的设备上。
I created a project, imported the two jar files and builded a java testcase scenario (the one from the tutorial.) after that I created an uitest projekt with shell command line. updated the build.xml created a jar file and pushed it onto my device.
就这一点而言,一切都很顺利。
As far as good everything worked nicely upon this point.
但是尝试使用命令行运行我的测试:
But tryin to run my tests with the command line:
adb -s <ANDROID_SERIAL> shell uiautomator runtest DeviceUnlocker.jar -c c.d.d.DeviceUnlocker
我只收到错误:
INSTRUMENTATION_RESULT:shortMsg = java.lang.RuntimeException
INSTRUMENTATION_RESULT:longMsg =在路径上找不到类cddDeviceUnlockingPseudoCodeTest:/ system /framework/android.test.runner.jar:/system/framework/uiautomator.jar :: /data/local/tmp/DeviceUnlocker.jar
INSTRUMENTATION_RESULT: shortMsg = java.lang.RuntimeException
INSTRUMENTATION_RESULT: longMsg=Didn't find class "c.d.d.DeviceUnlockingPseudoCodeTest on Path: /system/framework/android.test.runner.jar: /system/framework/uiautomator.jar:: /data/local/tmp/DeviceUnlocker.jar
INSTRUMENTATION_CODE:0
INSTRUMENTATION_CODE: 0
推荐答案
好的最简单的方法是只在eclipse中创建一个新的android junit projekt。
okay the easiest way is to only create inside eclipse a new android junit projekt.
我认为这或多或少等于uiautomator。
我觉得你可能有同样的机会......如果我错了,请纠正我......
i think this is more or less equal to uiautomator. and i think you might have the same oportunities ... correct me if i'm wrong...
uiautomator仍然没有运行...我还发现了一些来自android本身的uibuild.xml中的错误
uiautomator is still not running... and i also found some bugs in the uibuild.xml from android itself
< target name =testdescription =运行测试> ;
<! - todo:修复此问题 - >
< fail message =从Ant尚未支持启动测试/>
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="shell" />
<arg value="uiautomator" />
<arg value="runtest" />
<arg value="${out.filename}" />
<arg value="-e" />
<arg value="class" />
<arg value="com.android.uiautomator.samples.skeleton.DemoTestCase" />
</exec>
</target>`
感谢您的帮助。对我来说uiautomator不再是一个选择。
问候
thanks for your help. for me uiautomator is no option anymore. regards
这篇关于android uiautomator runtest错误没找到类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!