ActivityInstrumentationTestCase2 - sendkeys
I'm trying to test my application through
ActivityInstrumentationTestCase2. I have a few clickables in my UI. I use
sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
sendKeys(KeyEvent.KEYCODE_DPAD_CENTER); etc to simulate keyevents on my
UI.
The problem is is my app is kinda slow whereas the test case is relatively
fast. So what's happening is that the keyevents sometimes click/navigate
to the wrong UI element and that messes up the test case.
Is there any other way of simulating keyevents with a tiny bit of delay ?
For now i'm using Thread.sleep(500) to introduce a minor delay.
Is there a more elegant way of doing it other than using Thread.sleep() ?
Note: I am aware of Robotium and I'd appreciate it if the answers were
related to the Android Test Framework. Thanks.
No comments:
Post a Comment