Hi All,

I will tell you more simple way. To execute the test cases of sample
application provided by google please follow the following steps.

1. Open Eclipse and move to your desired workspace.
2. Create new Android Project and select Create Project from existing
source.
3. Browse to any sample project for example Snake
4. Build and execute the application to check whether it is properly
installed.
5. In Project Explorer Drag the file SnakeTest.java to source folder.
6. Open AndroidManifest.xml which resides inside the folder test.
7. Copy following lines

<instrumentation android:name="android.test.InstrumentationTestRunner"
      android:targetPackage="com.example.android.snake"
      android:label="Snake sample tests">
</instrumentation>
8. Paste these lines to the file AndroidManifest.xml which resides in the
application.
9. Add following line in the AndroidManifest
   <uses-library android:name="android.test.runner" />
10. Now save and Run the configuration.
11. Now close the application on emulator.
12. open Dev Tools
13. Go to Instrumentation
14. Select Snake Sample Tests.
15. The test cases will execute. Check the Logs for the result.
16. You can also execute the following commands in the command prompt
adb shell am instrument -w
com.example.android.snake/android.test.InstrumentationTestRunner

This will print the results on command prompt

Regards
Pankaj Bisaria


2009/3/15 Gavin Aiken <[email protected]>

> Hey,
>
> You can't run these tests as simple java JUnit tests, they need to be run
> on the device. The process is pretty straight forward and is best explained
> here;
>
> http://dtmilano.blogspot.com/2008/11/android-testing-on-android-platf.html
>
> What I am currently trying to work out is how to debug my tests now that I
> can run them! I'm sure it's a flag that I need to pass to the command line
> argument but I can't work it out.
>
> Hope this helps,
>
> Gav
>
> On Wed, Jan 28, 2009 at 10:53 PM, [email protected] <[email protected]>wrote:
>
>>
>> Hi,
>>
>> I am trying to run the 'AllTests' of ApiDemos in the android sdk
>> sample.
>>
>> When I run the
>> I get this when I select 'AllTests' and then click 'Debug->Run as
>> Junit Test'
>>
>> Problems Launching JUnit Tests
>> The input type of the launch configuration does not exist'
>>
>> Can you please tell me how to fix my problem?
>>
>> Thank you.
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to