0

I'm starting to look at android monkeyrunner, and would like to test my application with it.

My application opens a Notification in the android pull-down menu, and I would like monkeyrunner to test if the notification behaves correctly. Is it possible to use monkeyrunner to "click" on an incoming notification and verify the result?

I've searched the documentation, and it seems like I can only test activities, but maybe I'm missing something.

n8schloss
  • 2,723
  • 2
  • 19
  • 27
Thomas M.
  • 1,496
  • 1
  • 10
  • 21

1 Answers1

1

MonkeyRunner is able to interact with the entire device. But it may be hard to correctly setup a drag event to get the notification bar. An easier way to tell what's in your notification bar might be to use adb shell dumpsys notification. You could do this in MonkeyRunner by doing device.shell('dumpsys notification').

n8schloss
  • 2,723
  • 2
  • 19
  • 27
  • The problem is, that I also want to check what happens, when I click on the notification, not just want to check if the notification is there. Can this be done via MonkeyRunner? And what exactly do you mean by "It may be hard to..." – Thomas M. Jul 02 '12 at 09:52
  • MonkeyRunner is able to touch every part of the screen, so you would need to use MonkeyDevice.drag in order to drag down the notification bar. At that point you would need to use MonkeyDevice.touch in order to touch the notification. – n8schloss Jul 02 '12 at 17:18
  • You may also need to recognize where in the expanded notification list is your notification because there may be others – Diego Torres Milano Jul 05 '12 at 03:30