报错信息很明显,因为当前页是 MainActivity,SplashActivity 木有开始,但是每次都改也不是个事情😂 😂

E       selenium.common.exceptions.SessionNotCreatedException: Message: A new session could not be created. (Original error: com.xxx.test/.ui.activity.SplashActivity never started. Current: com.xxx.test/.ui.activity.MainActivity)

Driver 的配置是这样写的,看文档说是如果写了 APP 就不需要再专门写 Activity、appWaitAcitvity 的属性了,但实际运行还是会报 “A new session could not be created. (Original error: Permission to start activity denied”

......
self.desired_caps['app'] = os.getcwd() + '\\resource\\test.apk'
......

没有办法,为了调试只能再加上

......
self.desired_caps['app'] = os.getcwd() + '\\resource\\test.apk'
self.desired_caps['appActivity'] = '.ui.activity.MainActivity'
......

有没有什么好的解决方法,或者是因为我用的不正确,请教~~


↙↙↙阅读原文可查看相关链接,并与作者交流