Appium在等待root AccessibilityNodeInfo 10000毫秒后超时

标签 appium appium-android python-appium

偶尔出现以下 appium 错误,不知道如何解决。有什么方法可以增加此超时或帮助解决此问题?感谢您的帮助。

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: io.appium.uiautomator2.common.exceptions.UiAutomator2Exception: Timed out after 10000 milliseconds waiting for root AccessibilityNodeInfo
    at io.appium.uiautomator2.utils.AXWindowHelpers.refreshRootAXNode(AXWindowHelpers.java:78)
    at io.appium.uiautomator2.handler.Source.safeHandle(Source.java:38)
    at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:36)
    at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:250)
    at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:241)
    at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    at java.lang.Thread.run(Thread.java:764)

../../.ve/qa/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException

最佳答案

实际上,您在这里无能为力。您遇到的异常发生在 system function call :

root = UiAutomatorBridge.getInstance().getAccessibilityRootNode();

它调用 following code :

    public AccessibilityNodeInfo getAccessibilityRootNode() throws UiAutomator2Exception {
        Object queryController = invoke(method(UiDevice.class, "getQueryController"), Device.getUiDevice());
        return (AccessibilityNodeInfo) invoke(method(queryController.getClass(), "getRootNode"), queryController);
    }

这不是 Appium 的问题,而是 Uiautomator 的问题 Google ,Appium 在幕后使用。

从代码中可以看出,您不能增加超时。我建议尝试重置设备/使用其他设备/模拟器。

关于Appium在等待root AccessibilityNodeInfo 10000毫秒后超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55883965/

相关文章:

apache-poi - 尝试将我的 excel 测试用例覆盖到 testing-xml 时出现以下错误

java - 无法在 Android 应用程序中弹出自动警报的 appium 中定位元素

java - 如何在appium中的菜单栏中向右滚动?

java - Appium : how to check device name using automation test cases in java

android - 使用 appium 和 python 的 android 应用程序的功能测试

java - PageFactory 给出空指针异常

android - 通过下一个测试用例的 appium java 脚本重新打开应用程序

java - Appium水平滚动屏幕上的滚动问题

python-2.7 - 是否可以使用机器人框架进行Windows Mobile测试?

python - 移动滚动命令在 iOS 应用程序的 appium 1.5 中不起作用