I agree with Rama, sending keystrokes is nice, but it seems cumbersome
when you really want to click something clickable in an activity.  I
only see sendKeys in InstrumentationTestCase.

Is there a "proper" way to simulate a button click using something in
ActivityInstrumentationTestCase(2) or some other part of the testing
framework?  Is there a "sendClick" somewhere that we are missing?

mark

On Jul 7, 3:33 am, Raju <ramaraj...@gmail.com> wrote:
> Hi Dianne,
>
> Thanks for the response, this solution solved my problem partially.
>
> By navigating to the required button by using sendkeys (trail and
> error) then clicking on that button.
>
> My concern is, I'm developing a tool which should simulate user
> actions on any application irrespective of controls' location in the
> view.
>
> If we have the simulation methods like, xxxx.doClick(), or
> xxxx.setFocus(), which may help the developers to simulate the user
> actions in a better way.
>
> Can you give me, is there any alternative (other than
> Instrumentation), if not, is it possible to enhance the API with
> required simulation functions?
>
> Thanks,
> Rama Raju.
>
> On Jul 6, 9:57 pm, Dianne Hackborn <hack...@android.com> wrote:
>
> > You use Instrumentation.  This may 
> > help:http://mylifewithandroid.blogspot.com/2008/12/instrumentation-and-jun...
>
> > The Instrumentation class has methods to send events and interact with the
> > application in other ways.
>
> > On Mon, Jul 6, 2009 at 4:06 AM, Raju <ramaraj...@gmail.com> wrote:
>
> > > Hi,
>
> > > I'm trying automate UI Functional testing of my application.
>
> > > 1) First phase: Record the user actions and playing back the same.
> > > 2) Second Phase: Adding Validation Capability to Recorded scripts.
>
> > > In First Phase:
> > > I'm able to automate the Text/Editbox control actions without any
> > > issues, because we need to Set the Text of the control to the recorded
> > > value, so, its simple.
> > > While coming to Button Control actions, we need to simulate user
> > > actons, like Clicking on button.
>
> > > Can anyone suggest me, Do we have any mechanism, which can simulate
> > > button click event in Android?
>
> > > Thanks,
> > > Rama Raju
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.- Hide quoted text -
>
> > - Show quoted text -
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to