当前位置:网站首页>[appium stepping pit] close the inspector and open the WebEditor, uiautomator2 exceptions. NullPointerExceptionError: -32001 Jsonrpc er

[appium stepping pit] close the inspector and open the WebEditor, uiautomator2 exceptions. NullPointerExceptionError: -32001 Jsonrpc er

2022-06-21 12:32:00 Qinghe tester

solve

1、 mobile phone - ATX app - End operation ,
2、 Command line re-enter :weditor, Webpage 「dump hierarchy」 normal

Problems arise

1、 Use appium inspector After locating the element , close
2、 Command line input :weditor start-up weditor Webpage , Click on 「dump hierarchy」 Time error Popup
 Insert picture description here

Detailed error information


[W 220620 18:58:56 __init__:493] [pid:44430] [ed0335e2] jsonrpc call got: -32001 Jsonrpc error: <java.lang.NullPointerException> data: java.lang.NullPointerException: Attempt to read from field 'int android.accessibilityservice.AccessibilityServiceInfo.flags' on a null object reference
    	at androidx.test.uiautomator.UiDevice.setCompressedLayoutHeirarchy(UiDevice.java:234)
    	at com.github.uiautomator.stub.AutomatorServiceImpl.dumpWindowHierarchy(AutomatorServiceImpl.java:295)
    	at com.github.uiautomator.stub.AutomatorServiceImpl.dumpWindowHierarchy(AutomatorServiceImpl.java:284)
    	at java.lang.reflect.Method.invoke(Native Method)
    	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.invoke(JsonRpcBasicServer.java:467)
    	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleObject(JsonRpcBasicServer.java:352)
    	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleJsonNodeRequest(JsonRpcBasicServer.java:283)
    	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleRequest(JsonRpcBasicServer.java:251)
    	at com.github.uiautomator.stub.AutomatorHttpServer.serve(AutomatorHttpServer.java:100)
    	at fi.iki.elonen.NanoHTTPD.serve(NanoHTTPD.java:2244)
    	at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945)
    	at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
    	at java.lang.Thread.run(Thread.java:920)
    , method: dumpWindowHierarchy
[E 220620 18:58:56 web:1789] Uncaught exception GET /api/v2/devices/android%3A0335e2/hierarchy (::1)
    HTTPServerRequest(protocol='http', host='localhost:17310', method='GET', uri='/api/v2/devices/android%3A0335e2/hierarchy', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "/usr/local/lib/python3.9/site-packages/tornado/web.py", line 1702, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/usr/local/lib/python3.9/site-packages/weditor/web/handlers/page.py", line 94, in get
        self.write(d.dump_hierarchy2())
      File "/usr/local/lib/python3.9/site-packages/weditor/web/device.py", line 42, in dump_hierarchy2
        page_xml = self._d.dump_hierarchy(pretty=True)
      File "/usr/local/lib/python3.9/site-packages/decorator.py", line 232, in fun
        return caller(func, *(extras + args), **kw)
      File "/usr/local/lib/python3.9/site-packages/retry/api.py", line 73, in retry_decorator
        return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
      File "/usr/local/lib/python3.9/site-packages/retry/api.py", line 33, in __retry_internal
        return f()
      File "/usr/local/lib/python3.9/site-packages/uiautomator2/__init__.py", line 978, in dump_hierarchy
        content = self.jsonrpc.dumpWindowHierarchy(compressed, None)
      File "/usr/local/lib/python3.9/site-packages/uiautomator2/__init__.py", line 480, in __call__
        return self.server._jsonrpc_retry_call(self.method, params,
      File "/usr/local/lib/python3.9/site-packages/uiautomator2/__init__.py", line 494, in _jsonrpc_retry_call
        return self._jsonrpc_call(*args, **kwargs)
      File "/usr/local/lib/python3.9/site-packages/uiautomator2/__init__.py", line 556, in _jsonrpc_call
        raise err
    uiautomator2.exceptions.NullPointerExceptionError: -32001 Jsonrpc error: <java.lang.NullPointerException> data: java.lang.NullPointerException: Attempt to read from field 'int android.accessibilityservice.AccessibilityServiceInfo.flags' on a null object reference
    	at androidx.test.uiautomator.UiDevice.setCompressedLayoutHeirarchy(UiDevice.java:234)
    	at com.github.uiautomator.stub.AutomatorServiceImpl.dumpWindowHierarchy(AutomatorServiceImpl.java:295)
    	at com.github.uiautomator.stub.AutomatorServiceImpl.dumpWindowHierarchy(AutomatorServiceImpl.java:284)
    	at java.lang.reflect.Method.invoke(Native Method)
    	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.invoke(JsonRpcBasicServer.java:467)
    	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleObject(JsonRpcBasicServer.java:352)
    	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleJsonNodeRequest(JsonRpcBasicServer.java:283)
    	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleRequest(JsonRpcBasicServer.java:251)
    	at com.github.uiautomator.stub.AutomatorHttpServer.serve(AutomatorHttpServer.java:100)
    	at fi.iki.elonen.NanoHTTPD.serve(NanoHTTPD.java:2244)
    	at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945)
    	at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
    	at java.lang.Thread.run(Thread.java:920)
    , method: dumpWindowHierarchy
[E 220620 18:58:56 web:2239] 500 GET /api/v2/devices/android%3A0335e2/hierarchy (::1) 421.46ms
原网站

版权声明
本文为[Qinghe tester]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/06/202206211223372561.html