Can you attach some code snippets from your test app? Are you using clickView() or tapView()?
You must call setActivityInitialTouchMode(true) before you do a startActivity(). Seems that you're doing this if you call it in setUp(), although I could be wrong. Unfortunately, I'm not familiar with Robotium. Instrumentation should be able to feed touch events to the Activity. Notice that the test method that you use for this must run on the UI thread, but you should already see that if you're not doing it. To do it, you use @runOnUIThread for the entire method, or use a Runnable for just a small subset of statements. This is documented in the SDK 2.2 documentation under Testing and Instrumentation. There's a section in that topic called "Testing on the UI Thread" that has some examples. On Aug 5, 11:59 pm, Fabrizio Giudici <[email protected]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 8/5/10 19:11 , A. Elk wrote: > > > In other words, you can do button presses in a "sample" Android > > app from a test package, but you can't do them from your app's > > test package to the app under test. > > Right. > > > (The test package is the same as the "test app" and the "app under > > test" is the application you're trying to build.) > > > Are you using ActivityInstrumentationTestCase2 as your test case > > class? I assume that you're calling TouchUtils.clickView(t,v) > > where > > > t is the test case object (probably _this_), and v is the Button > > object you want to click, in the Activity you're testing in the > > app under test. > > I'm trying _also_ with TouchUtils.clickView(); I'm also exploring > other testing frameworks. The cited Robotium, for instance, creates > MotionEvents with the DOWN/UP sequence and the proper position and > feeds them to the Instrumentation (yes, I'm using AITC2). I've > manually verified that the events are properly created (uptime, > coordinates are ok - tested with the hierarchyviewer - etc). > > Yesterday night I discovered that tests launched my application not in > touch mode (in fact, I could see a focused button in orange). This > would have been an explanation, but then I explicitly added > setActivityInitialTouchMode(true) in setUp(), I got a visual > confirmation that it has been accepted (I no more see a focused > button), but it's not yet working. > > - -- > Fabrizio Giudici - Java Architect, Project Manager > Tidalwave s.a.s. - "We make Java work. Everywhere." > java.net/blog/fabriziogiudici -www.tidalwave.it/people > [email protected] > -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.14 (Darwin) > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/ > > iEYEARECAAYFAkxbsrYACgkQeDweFqgUGxfhaACfZpiS5INwfKXAHoblnkbGammP > dbwAn0WuoLcxXkTbDzj8qRORCEVZQaUf > =3h7h > -----END PGP SIGNATURE----- -- 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

