Monkeyrunner seems the perfect tool, but I found it very hard to have it execute a given scenario reliabily. The two main problems I encountered were:
- Entering data in a form
- Triggering context menu in listviews
device.press('KEYCODE_ENVELOPE', MonkeyDevice.DOWN)
The method handling the key in the activity class is onKeyDown
.You can find examples in the classes AccountEdit, ExpenseEdit, SelectAccount and SelectCategory from here (tag r25). In the editing activities, I populate the form with data, in the selection activities, I make sure that the listview has the focus, I found no other reliable method to have the context menu triggered from Monkeyrunner.
No comments:
Post a Comment