记录appium获取通知栏内容时,遇到的坑。
在做push类自动化测试时,需要获取到通知栏内是否有收到消息。如何才能获取到通知栏内容呢。第一想法可能是,直接打开通知栏。但是这个方法不同的手机定位时会有限制。appium setting app已经提供了方法 appium setting使用说明
但是在执行adb shell am broadcast -a io.appium.settings.notifications命令后会报ations
Broadcasting: Intent { act=io.appium.settings.notifications flg=0x400000 }
Broadcast completed: result=-1, data="Appium Settings helper has no access to the system notifications. The access must be granted manually via ‘Notification access’ page in device Settings."错误
是因为未打开appium setting的通知使用权限,改权限比较难找,最后在设置的搜索中,搜索通知才能看到
最终获取到的通知栏内容
appium获取通知栏内容和短信内容
最新推荐文章于 2024-07-26 20:15:44 发布
本文主要介绍了在使用Appium进行自动化测试时,如何获取Android设备的通知栏内容。在执行adb shell am broadcast -a io.appium.settings.notifications命令后遇到权限问题,需要手动在设备设置的‘Notification access’页面开启Appium Settings的权限。通过解决这个问题,成功获取通知栏的消息。
摘要由CSDN通过智能技术生成