UiAutomator bug while inspecting WebView elements

﹥>﹥吖頭↗ 提交于 2019-12-24 00:53:44

问题


I have recently started automation testing in android and was using UiAutomator tool for inspecting UI elements. Surprisingly, I came across two different responses for Webview elements for the same screen and same device [Genymotion MotoX 4.4.4]. Attached are the screenshots for the same. We all know that appium has an issue with inspecting webview elements who do not carry "setWebContentsDebuggingEnabled" to true. Is this a bug in UiAutomator?


回答1:


We all know that appium has an issue with inspecting webview elements who do not carry "setWebContentsDebuggingEnabled" to true. Is this a bug in UiAutomator?

NO, its not a bug. Its an IMPLEMENTATION as is. Unless the setWebContentsDebuggingEnabled is set to true, you cannot debug or access any elements inside a webview.

To quote from developers.android.com

void setWebContentsDebuggingEnabled (boolean enabled)

Enables debugging of web contents (HTML / CSS / JavaScript) loaded into any WebViews of this application. This flag can be enabled in order to facilitate debugging of web layouts and JavaScript code running inside WebViews. Please refer to WebView documentation for the debugging guide. The default is false.

You might be interested into these as well :

Migrating to WebView in Android 4.4



来源:https://stackoverflow.com/questions/37274388/uiautomator-bug-while-inspecting-webview-elements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!