1

i am trying to run my test class as Android Junit Test through Eclipse and then its giving could not find test class excpetion.

I have properly mentioned the intrumentation target package to my productive code package.

Below is the android manifest

<?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>

I have also checked by build path, its properly including the target classes such that the class file could be found.

Not able to find what is the problem.

Thanks and Regards, Saurav

1
  • Where does Android junit test picks it classes ?...i preseume its bin/classes which is in the build path...can not figure out on what is the problem Commented Nov 26, 2013 at 12:11

2 Answers 2

1

I removed my project and got the latest version from my source code repo.

Then i ran my tests it did work.

But would like to know why the problem was there.

Where does Android junit test picks it classes when running from Eclipse ?...i presume its bin/classes which is in the build path...can not figure out on what is the problem

Sign up to request clarification or add additional context in comments.

Comments

0

Did you check if you are setting up properly? See this link http://developer.android.com/tools/testing/activity_test.html

Also you can think of using Robotium for testing. https://code.google.com/p/robotium/

3 Comments

I did ...i forgot to mention i am using maven to build my project
code.google.com/p/maven-android-plugin/wiki/… you can have a look at that link
I'm also trying to resolve this issue with a Maven project. I followed the link which explains how to successfully test using Maven but does not explain how to run the tests from Eclipse after this change.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.