Appium uiautomator在测试微信公众号或者小程序的页面时,source接口超时

问题

使用Appium进行微信小程序的自动化测试时,进入小程序的页面,调用uiautormator底层的source接口会报错,导致后续的任何操作都无法继续进行下去。

“Timed out after 15519ms waiting for the root AccessibilityNodeInfo in the active window. Make sure the active window is not constantly hogging the main UI thread (e.g. the application is being idle long enough), so the accessibility manager could do its work”,“stacktrace”:"io.appium.uiautomator2.common.exceptions.UiAutomator2Exception: Timed out after 15519ms waiting for the root AccessibilityNodeInfo in the active window. Make sure the active window is not constantly hogging the main UI thread (e.g. the application is being idle long enough), so the accessibility manager could do its work

报错信息

调试了下uiautomator的工程,发现时最终的底层调用 getRootInActiveWindow 方法一直返回null。底层自己也做了6次重试,一直不成功。

不清楚是不是uiautomator 自身有什么bug?还是微信小程序的页面有些阻塞它dump视图的操作。

环境

github上最新的uiautomator-server工程。