Monday, April 25, 2011

[android-developers] Re: How to send combination keys in functional testing

You can use something like this:

sendKeys(KeyEvent.KEYCODE_ALT_LEFT, KeyEvent.KEYCODE_9,
KeyEvent.KEYCODE_ALT_LEFT, KeyEvent.KEYCODE_0);
assertEquals("()", mTV.getText().toString());

On Apr 25, 2:38 am, Rui <kae...@gmail.com> wrote:
> Hello,
>
> I am trying to test my application with
> ActivityInstrumentationTestCase2. My application is for a specific
> hardware, which has a hardware keyboard including ctrl and alt key,
> and has functions which are fired by combination keys, e.g., Ctrl +
> BackSpace, Ctrl + C, Ctrl + Right, and etc.
>
> Does anybody know how to send these combination keys to Android
> applications?
>
> Thank you for advance.
> -Rui

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate