运行Android Junit时找不到测试类异常

时间:2013-11-26 11:02:05

标签: android android-testing

我正在尝试通过Eclipse运行我的测试类作为Android Junit测试,然后它的贡献无法找到测试类的重复。

我已经在我的高效代码包中正确提到了intrumentation target包。

以下是android清单

<?xml version="1.0" encoding="utf-8"?>

<uses-sdk android:minSdkVersion="15" />

<instrumentation
    android:name="android.test.InstrumentationTestRunner"
    android:targetPackage="com.abc.android" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <uses-library android:name="android.test.runner" />
</application>

我还检查了构建路径,它正确地包含了目标类,以便找到类文件。

无法找到问题所在。

谢谢和问候, Saurav

2 个答案:

答案 0 :(得分:1)

我删除了我的项目并从我的源代码库中获得了最新版本。

然后我运行我的测试它确实有效。

但是想知道问题出在何处。

从Eclipse运行时,Android junit测试从哪里选择类?...我假设它在构建路径中的bin / classes ...无法弄清楚是什么问题

答案 1 :(得分:0)

您是否检查过您是否正确安装?看到这个链接 http://developer.android.com/tools/testing/activity_test.html

您也可以考虑使用Robotium进行测试。 https://code.google.com/p/robotium/

相关问题