Appium打开页面失败:The permission to start '.ui.InitServerActivity' activity has been denied

一、错误提示

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.netelis.yobot' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: The permission to start '.ui.InitServerActivity' activity has been denied.Make sure the activity/package names are correct.

二、解决

原因是打开InitServerActivity时,无权限,需要添加权限,打开Android App 代码,在AndroidManifest.xml中给InitServerActivity加上权限配置

android:exported="true"

但不建议直接改App源码,给太多的Activity加exported属性,出现安全性问题,建议自动化测试时所有用例都从启动页开始,而不是直接跳转到某一个页面。

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容