gpt4 book ai didi

android - AndroidViewClient : The views are being refreshed too frequently to dump的dump问题

转载 作者:行者123 更新时间:2023-11-29 20:48:01 41 4
gpt4 key购买 nike

我需要使用 AndroidViewClient 做一些自动化测试。在我的代码中,我使用了 ViewClient 的 dump()。但我通常会遇到以下错误:

RuntimeError: The views are being refreshed too frequently to dump.

它可能由此引发:

ERROR: could not get idle state.

dtmilano(Android应用测试指南作者)answered a similar problem in this question .他说 uiautomator 有一个限制。

但是我的API号是19,为什么还有uiautomator限制?我该如何处理这个问题?如何使用waitforidle()

最佳答案

这是一个UiAutomator限制。

正如我在另一个答案中提到的,另一种方法是使用系统 ViewServe r 作为后端,如果你的设备有 secure mode 禁用或 LocalViewServer 如果您的设备处于安全模式但您可以访问被测应用程序的源代码。

编辑

ViewCliet 处理上述后端的差异。也就是说,相同的脚本可以使用不同的后端不加改动地运行。

例如,要强制 dump 使用ViseServer 只需运行

$ dump --force-view-server-use --all

您可以在脚本中执行相同的操作。

关于android - AndroidViewClient : The views are being refreshed too frequently to dump的dump问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29896826/

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