无法点击 Android Lollipop 上的网页视图链接

Unable to click on webview links on Android Lollipop

我在测试移动应用程序时使用以下示例代码进行点击。

JavascriptExecutor js = (JavascriptExecutor) DeviceWrapper.getAppiumDriver();
HashMap tapObject = new HashMap();
tapObject.put("touchCount", (double) 1);
tapObject.put("duration", (double) 0.001);
tapObject.put("x", 160.0);
tapObject.put("y", 540.0);
js.executeScript("mobile: tap", tapObject);

此代码在 运行 Android 4.x 设备上运行良好,但在 运行 Android 5.x 设备上运行失败。具体来说,它在点击 webview links 时失败。我可以在 Appium Inspector 中看到它确实点击了 webview link,并且 link 带有下划线,但是点击并没有像预期的那样进入下一个屏幕。

只是想知道是否有人有任何想法。谢谢你。 我在 Mac.

上使用 Appium 1.3.5 版

Android 不支持 5.1

目前,Android 5.1 不受支持。检查 appium 的 Github 问题跟踪器显示以下 result 建议 Android Appium 1.5 将支持 5.1。

Webview 问题仍然存在于 Android 5.0.x

虽然支持 Android 5.0.x 版本,但问题跟踪器中发布的网页视图存在问题,但没有 resolve。看起来好像该错误已被指定为已修复,但它目前存在于 appium 1.3 中。4_1

做什么:

目前,appium webview 问题存在于 Android 5.0+,但很可能会得到修复 soon with the new automation backend. If you need to push production code you will have to test without appium. Also, you may consult the github page for advice