【发布时间】:2018-10-15 11:20:08
【问题描述】:
我在为原生 android 应用创建自动化测试时遇到了问题(使用来自 webdriver.io + typescript 的 appium)。
目前我正在尝试通过 id 在 android manifest 中有 android:launchMode="singleInstance" 的活动上单击按钮。
我遇到了 appium 在此活动中找不到任何元素的问题。 日志看起来像:
[debug] [JSONWP Proxy] Proxying [POST /elements] to [POST http://localhost:8203/wd/hub/session/8938c098-48e6-4e7b-b9fd-4cf69034058c/elements] with body: {"strategy":"id","selector":"callStatus","context":"","multiple":true}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"8938c098-48e6-4e7b-b9fd-4cf69034058c","status":0,"value":[]}
[debug] [MJSONWP] Responding to client with driver.findElements() result: []
顺便说一句。我无法使用 UIAutomatorView 检查该活动,看起来问题也与它有关。
如果删除 android:launchMode="singleInstance" 标志 - 一切都会正常工作。
如何解决这个问题?
如何找到带有android:launchMode="singleInstance" 标志的活动元素?
【问题讨论】:
标签: android automated-tests appium webdriver-io