gpt4 book ai didi

android - 检查 WebView 元素时出现 UiAutomator 错误

转载 作者:搜寻专家 更新时间:2023-11-01 09:47:32 26 4
gpt4 key购买 nike

我最近开始在 android 中进行自动化测试,并使用 UiAutomator 工具检查 UI 元素。令人惊讶的是,我遇到了针对同一屏幕和同一设备 [Genymotion MotoX 4.4.4] 的 Webview 元素的两种不同响应。附件是相同的屏幕截图。我们都知道 appium 在检查未将“setWebContentsDebuggingEnabled”设置为 true 的 webview 元素时存在问题。这是 UiAutomator 中的错误吗? Screen displaying child elements of webview

Screen without WebView children

最佳答案

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

,这不是错误。它是一个实现。除非 setWebContentsDebuggingEnabled 设置为 true,否则您无法调试或访问 webview 内的任何元素。

引自developers.android.com

void setWebContentsDebuggingEnabled (boolean enabled)

Enablesdebugging of web contents (HTML / CSS / JavaScript) loaded into anyWebViews of this application. This flag can be enabled in order tofacilitate debugging of web layouts and JavaScript code running insideWebViews. Please refer to WebView documentation for the debuggingguide. The default is false.

你可能也对这些感兴趣:

Migrating to WebView in Android 4.4

关于android - 检查 WebView 元素时出现 UiAutomator 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37274388/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com