airtestproject / hrpc Goto Github PK
View Code? Open in Web Editor NEWCommon interface definition based rpc implementation
License: Apache License 2.0
Common interface definition based rpc implementation
License: Apache License 2.0
描述问题bug:
我使用 b64img, fmt = poco.snapshot(width=screen_size[1])
进行截图时, 出现 hrpc.exceptions.RpcRemoteException 异常, 异常信息如下:
File "/usr/local/python3/lib/python3.7/site-packages/flybirds/core/plugin/plugins/default/screen.py", line 31, in screen_shot
b64img, fmt = poco.snapshot(width=screen_size[1])
File "/usr/local/python3/lib/python3.7/site-packages/poco/pocofw.py", line 433, in snapshot
return self.agent.screen.getScreen(width)
File "/usr/local/python3/lib/python3.7/site-packages/poco/drivers/android/uiautomation.py", line 75, in getScreen
b64img = self.screen.getScreen(width)
File "/usr/local/python3/lib/python3.7/site-packages/hrpc-1.0.9-py3.7.egg/hrpc/object_proxy.py", line 92, in __call__
return self._client__.evaluate(self.__call_no_evaluate__(remote_obj_cache, *args))
File "/usr/local/python3/lib/python3.7/site-packages/hrpc-1.0.9-py3.7.egg/hrpc/client.py", line 81, in evaluate
raise RpcRemoteException(resp)
hrpc.exceptions.RpcRemoteException: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getHeight()' on a null object reference
|-- Remote Traceback --|
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getHeight()' on a null object reference
at com.netease.open.pocoservice.Screen.getScreen(Screen.java:40)
at java.lang.reflect.Method.invoke(Native Method)
at com.netease.open.hrpc.backend.RpcServer.onRequest(RpcServer.java:171)
at com.netease.open.hrpc.backend.RpcServer.serve(RpcServer.java:57)
at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:840)
at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:189)
at java.lang.Thread.run(Thread.java:920)
|-- Remote Traceback end --|
python 版本: python3.7
pocoui版本: 1.0.85
hrpc 版本: 1.0.9
设备:
INTERNALERROR> File "/Users/test/Project_pytest/new_auto_test/test-app-autotest/conftest.py", line 88, in capture_screenshot
INTERNALERROR> screenshot, fmt = poco.snapshot(width=720)
INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/poco/pocofw.py", line 433, in snapshot
INTERNALERROR> return self.agent.screen.getScreen(width)
INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/poco/drivers/android/uiautomation.py", line 73, in getScreen
INTERNALERROR> b64img = self.screen.getScreen(width)
INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/hrpc/object_proxy.py", line 92, in __call__
INTERNALERROR> return self._client__.evaluate(self.__call_no_evaluate__(remote_obj_cache, *args))
INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/hrpc/client.py", line 81, in evaluate
INTERNALERROR> raise RpcRemoteException(resp)
INTERNALERROR> hrpc.exceptions.RpcRemoteException: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getHeight()' on a null object reference
hrpc.exceptions.RpcRemoteException 异常,并且又涉及到了android.graphics.Bitmap.getHeight()
错误,希望解决。
而且一般是卡在hrpc/object_proxy.py对象析构的时候
def __del__(self):
# 代理对象析构时,请求远程对象也析构,并不需要等待返回
if self._is_intermediate_uri__:
action = (('del', ()), )
self._client__.evaluate(RpcObjectProxy(self._uri__, self._client__, action), wait_for_response=False)
请求报文:
{"id": "", "uri": "[Lcom.netease.open.libpoco.sdk.AbstractNode;@184e8ec(61762182-3f08-4bbd-b836-49eddbe95f46)", "method": [["del", []]], "session_id": "3e6b0bdb-90a6-4dab-892c-3f3bac49f904"}
Exception ignored in: <function RpcObjectProxy.del at 0x1234687a0>
Traceback (most recent call last):
File "/Users/xs/PycharmProjects/airtest/hrpc/object_proxy.py", line 114, in del
self.client_.evaluate(RpcObjectProxy(self.uri_, self.client_, action), wait_for_response=False)
File "/Users/xs/PycharmProjects/airtest/hrpc/client.py", line 64, in evaluate
self.transport.send({'id': reqid, 'uri': obj_proxy.uri_, 'method': obj_proxy.invocation_path_})
File "/Users/xs/PycharmProjects/airtest/hrpc/transport/http.py", line 31, in send
raise TransportDisconnected(e)
hrpc.exceptions.TransportDisconnected: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.