【发布时间】:2020-07-28 00:44:57
【问题描述】:
目前开始使用 python 和 appium 自动化。我已经做了一些研究并开始连接到设备,但连接设备后我的应用程序无法启动。我有下面的脚本:
from appium import webdriver
url = 'http://jq.deviceconnect.com/Appium'
caps = {
'gigafox:UserName': 'admin',
'gigafox:ApiKey': '####',
'gigafox:application': 'com.google.android.youtube/com.google.
android.apps.youtube.app.application.Shell$HomeActivity',
'newCommandTimeout': 600000,
'gigafox:device': '58d5251c-89cd-4f7a-b2f1-8f316e292e0b',
'gigafox:SkipInstall': 'true',
'automationName': 'UIAutimator2'
}
# Start Appium session
print('creating Appium session')
driver = webdriver.Remote(url, caps)
driver.launch_app()
运行此程序后,我的设备已连接,但我的应用程序未启动并且构建完成。没有错误,所以我认为除了我的实现方式之外没有任何问题。
【问题讨论】:
-
我发现在尝试启动应用程序而不是 gigafox:application 时使用 appPackage 和 appActivity 有效。我不知道为什么,但我会使用它作为一种解决方法,直到我找出它为什么不起作用。
标签: python android automation appium