我最近开始在 android 中进行自动化测试,并使用 UiAutomator 工具检查 UI 元素。令人惊讶的是,我遇到了针对同一屏幕和同一设备 [Genymotion MotoX 4.4.4] 的 Webview 元素的两种不同响应。附件是相同的屏幕截图。我们都知道 appium 在检查未将“setWebContentsDebuggingEnabled”设置为 true 的 webview 元素时存在问题。这是 UiAutomator 中的错误吗?
最佳答案
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?
不,这不是错误。它是一个实现。除非 setWebContentsDebuggingEnabled
设置为 true
,否则您无法调试或访问 webview 内的任何元素。
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.
你可能也对这些感兴趣:
关于android - 检查 WebView 元素时出现 UiAutomator 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37274388/