首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Appium并没有在Android平台上启动对世博应用的测试

Appium并没有在Android平台上启动对世博应用的测试
EN

Stack Overflow用户
提问于 2019-07-24 12:33:14
回答 1查看 491关注 0票数 3

我的目标是用Appium在一个用世博会构建的应用程序上运行端到端的测试(海龟-cli)。

我尝试使用以下参数启动Appium-Desktop的测试会话:

代码语言:javascript
复制
{
  "platformName": "android",
  "deviceName": "ENU7N15B0300...",
  "app": "path-to-apk",
  "automationName": "UiAutomator2"
}

该应用程序在智能手机上启动,但我从Appium获得了一个超时错误:

代码语言:javascript
复制
[MJSONWP] Encountered internal error running command: Error: Cannot start the 'com.example.testetoeapplauda' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: 'Command 'adb -P 5037 -s ENU7N15B03007818 shell am start -W -n com.example.testetoeapplauda/host.exp.exponent.MainActivity -S' timed out after 20000ms'. Try to increase the 20000ms adb execution timeout represented by 'adbExecTimeout' capability

有趣的部分是亚行shell命令。当我手动运行这个命令时,应用程序会启动,但是命令没有完成--它只是永远挂起。

代码语言:javascript
复制
$ adb -P 5037 -s ENU7N15B03007818 shell am start -W -n com.example.testetoeapplauda/host.exp.exponent.MainActivity -S
Stopping: com.example.testetoeapplauda
Starting: Intent { cmp=com.example.testetoeapplauda/host.exp.exponent.MainActivity }

当我移除参数-W时,它不是阻塞。

您有关于如何在世博应用上启动Appium测试的建议吗?您知道如何更改Appium以避免使用-W标志吗?

这是apk,如果您想测试它:应用程序-测试apk文件

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-08-05 11:42:29

从appium 1.14.0中可以选择跳过等待:

代码语言:javascript
复制
appWaitForLaunch: false

这将允许在-W命令中避免使用adb选项。现在,您必须安装appium beta版本,因为它还没有发布。

npm install -g appium@beta

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57183060

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档