Search code examples
androidmonkeyrunner

Can monkeyrunner interact with android notifications?


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.


Solution

  • 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').