Appium 关于 Capabilities 参数配置 app 参数的疑惑

· 2015年04月01日 · 最后由 思寒_seveniruby 回复于 2015年04月02日 · 1204 次阅读

代码如下
from appium import webdriver
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.4.2'
desired_caps['deviceName'] = 'HONOR H30-L02'
desired_caps['app'] = r'D:\eshop.apk'

desired_caps['app'] = r'D:\epay.apk'

driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
print driver.network_connection
driver.close_app()

据说在配置 app 属性的时候不用配 appPackage 和 appActivity 这两个值,我现在这么做了以后就出现了一个问题:
使用 desired_caps['app'] = r'D:\epay.apk'这个配置项的时候可以正常启动 app,使用 desired_caps['app'] = r'D:\eshop.apk'这个配置项就报错,错误信息如下:selenium.common.exceptions.WebDriverException: Message: u"A new session could not be created. (Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity)"

请有了解的人指点一下。谢谢

共收到 3 条回复 时间 点赞

一楼正解!!

你自己试着读下那个文件, 看看存不存在

关闭了讨论 06月06日 17:45
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册