Hey ... The instrumentation classes in Android is useful in testing the basic functionalities like
1. Testing the layout .. (eg:- validating the relative position of the buttons, and error conditions) 2. Launching Activities and verifying their intents ... And so on . But its not much helpful in testing across activities like .. To find out which activity is currently running, which alert dialog is popped up. I think some more examples are needed to brief the capability of instrumentation ... The current example in Android SAMPLES for instrumentation is very less. - Sundar -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Andrew Stadler Sent: Friday, December 26, 2008 5:53 AM To: [email protected] Subject: [android-developers] Re: Testing a Android Activity.. Here is a quick reply of things to look at (not a tutorial): * See samples/ApiDemos which has examples of different kinds of tests. *ALWAYS* start here; If you can't get these working, there's no point in trying to get your own tests working. * To test standalone code (not Activities) you'll want to base your test on TestCase (for pure unit tests) or AndroidTestCase (for unit tests that require Context parameters). * To test Activities, you actually have three choices: ** InstrumentationTestCase will launch your app, and you can manually start activities and send events into them. This is good for testing UI state of your entire application, esp. if you want to track transitions between Activities, but less helpful for testing single Activities. ** ActivityInstrumentationTestCase will launch a specific activity, you can either send events into them or make calls directly to the object. This is usually more useful for testing single Activities. ** Both of those actually "launch" your activity within the real system (ActivityManager, etc). ActivityUnitTestCase will create your activity outside of the regular system, just as an isolated object, which is lighter weight but not all methods work properly. * There are also test case classes for other system classes, e.g. ApplicationTestCase. On Mon, Dec 22, 2008 at 1:54 AM, Manjunatha M (ಮಂಜುನಾಥ ಎಂ) <[email protected]> wrote: > Hi All, > > I need your help how to test the Android application. > > I need to test each activity and automate some test cases. > > Which class should be used to like "ActivityUnitTestCase" or any thing else? > > How do we run those test cases? > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" 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-developers?hl=en -~----------~----~----~----~------~----~------~--~---

