Reputation: 165
I want to run an android test case which from an android test project in a android application,such as i click a button then a test case start, i do not konw how to do it.
Upvotes: 1
Views: 1461
Reputation: 165
Thanks hackbod and his answer is perfect so I copy it here: ere is already an API for this, Context.startInstrumentation: http://developer.android.com/reference/android/content/Context.html#startInstrumentation(android.content.ComponentName, java.lang.String, android.os.Bundle)
Upvotes: 0
Reputation: 39
This is a good place to start, it well described
http://developer.android.com/resources/tutorials/testing/helloandroid_test.html
See the test example for HelloWorld first. Follow the steps as i said it's well described.
Then create a test project for your app and If you get stuck somewhere try adjusting the code from the example for your app.
Upvotes: 1