Robotium 求助:Robotium 跳到 H5 页面后找不到 WebView

Heyyu · 2016年09月21日 · 最后由 Heyyu 回复于 2016年09月23日 · 1599 次阅读


用 UiautomatorViewer 看确实是 webview,然后我尝试获取当前 webview

ArrayList<WebElement> webElements = solo.getCurrentWebElements();
solo.clickOnWebElement(webElements.get(0));

但是提示 webElements 的 size 是 0,有没有遇到过这种问题?

共收到 17 条回复 时间 点赞
Heyyu #16 · 2016年09月23日 Author

#16 楼 @lizhenghuan 有没有具体一点的方法?

简单,开发用了 crosswalk,那你也引入 crosswalk

Heyyu #15 · 2016年09月22日 Author

#14 楼 @dongdong 确实不是原生的,貌似 appium 也有这种问题。

ribotium 根本不需要打开 debug 模式,有可能你的 webview 不是原生的 ,我之前为 codova webview 重写了一下 robotium 的 webview 相关代码才能获取

Heyyu #13 · 2016年09月21日 Author

#12 楼 @sanlengjingvv adb 上看已经开了

#10 楼 @heyyuyu 哦哦,那你可以试下其他框架,比如https://github.com/alibaba/macaca

#7 楼 @heyniu 问了开发,用的不是安卓自带框架,没有这个,用的是 crosswalk。

#7 楼 @heyniu 非常感谢!


应该是这个

#4 楼 @heyyuyu 这个记得是要源代码打开,就是被测应用的代码打开

#3 楼 @heyniu 请问需要怎么打开呢?

#2 楼 @heyyuyu 是 WebView 的调试模式,不是 usb

#1 楼 @heyniu USB 调试打开了的

WebView 要开启调试模式才能拿到 id

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册