可以monkeyrunner与Android的通知互动? [英] Can monkeyrunner interact with android notifications?

查看:170
本文介绍了可以monkeyrunner与Android的通知互动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始看的Andr​​oid monkeyrunner,想用它来测试我的应用程序。

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

我的应用程序打开在Android的下拉菜单中选择一个通知,我想monkeyrunner来测试通知行为正确。是否有可能使用monkeyrunner对传入的通知点击和验证结果?

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.

推荐答案

MonkeyRunner能够与整个设备进行交互。但是,它可能很难正确地设置一个拖动事件得到通知栏。一个简单的方法告诉您的通知栏有什么可能是使用亚行外壳dumpsys通知。你可以通过做为此在MonkeyRunner device.shell('dumpsys通知')

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

这篇关于可以monkeyrunner与Android的通知互动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆