Poco icon indicating copy to clipboard operation
Poco copied to clipboard

IOS真机上poco使用set_text()不能输入是什么原因,用text可以

Open chen5079 opened this issue 4 years ago • 1 comments

IOS 11.2.5 poco使用set_text()不能输入是什么原因,用text可以 `def login(): print("账号登录") # 点击账号登录 poco("login_account").click() poco("login_account_account_input", type="TextField").click() sleep(1.0) #poco("login_account_account_input", type="TextField").set_text("[email protected]") text("[email protected]")

sleep(1.0)
poco("login_account_password_input").click()
sleep(1.0)
poco("login_account_password_input").set_text("123456")
sleep(1.0)
poco("login_account_login").click()`

Traceback (most recent call last): File "/Users/shimo/PycharmProjects/lovetest/test/airioscase.py", line 50, in check_canceBtn() File "/Users/shimo/PycharmProjects/lovetest/test/airioscase.py", line 47, in check_canceBtn login() File "/Users/shimo/PycharmProjects/lovetest/test/airioscase.py", line 35, in login poco("login_account_password_input").set_text("123456") File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/poco/proxy.py", line 802, in set_text return self.setattr('text', text) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/poco/proxy.py", line 39, in wrapped return func(self, *args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/poco/proxy.py", line 761, in setattr raise InvalidOperationException('"{}" of "{}"'.format(str(e), self)) poco.exceptions.InvalidOperationException: "Unable to set attribute "text" of node "{'name': 'login_account_password_input', 'payload': {'label': 'login_account_password_input', 'type': 'Other', 'name': 'login_account_password_input', 'rect': {'y': 266, 'x': 24, 'width': 327, 'height': 43}, 'size': [0.872, 0.06446776611694154], 'pos': [0.5, 0.43103448275862066], 'zOrders': {'local': 0, 'global': 0}, 'anchorPoint': [0.5, 0.5], 'visible': True}, 'children': [{'name': 'login_account_password_input', 'payload': {'label': 'login_account_password_input', 'type': 'Other', 'name': 'login_account_password_input', 'rect': {'y': 266, 'x': 24, 'width': 278, 'height': 42}, 'size': [0.7413333333333333, 0.06296851574212893], 'pos': [0.43466666666666665, 0.4302848575712144], 'zOrders': {'local': 0, 'global': 0}, 'anchorPoint': [0.5, 0.5], 'visible': True}, 'children': [{'name': 'login_account_password_input', 'payload': {'label': 'login_account_password_input', 'type': 'SecureTextField', 'name': 'login_account_password_input', 'rect': {'y': 266, 'x': 24, 'width': 278, 'height': 42}, 'size': [0.7413333333333333, 0.06296851574212893], 'pos': [0.43466666666666665, 0.4302848575712144], 'zOrders': {'local': 0, 'global': 0}, 'anchorPoint': [0.5, 0.5], 'visible': True}, 'parent': <poco.freezeui.hierarchy.Node object at 0x7fcfd82a9da0>}], 'parent': <poco.freezeui.hierarchy.Node object at 0x7fcfd82a9e48>}, {'name': 'Other', 'payload': {'label': None, 'type': 'Other', 'name': 'Other', 'rect': {'y': 266, 'x': 307, 'width': 44, 'height': 42}, 'size': [0.11733333333333333, 0.06296851574212893], 'pos': [0.8773333333333333, 0.4302848575712144], 'zOrders': {'local': 0, 'global': 0}, 'anchorPoint': [0.5, 0.5], 'visible': True}, 'children': [{'name': 'Other', 'payload': {'label': None, 'type': 'Other', 'name': 'Other', 'rect': {'y': 266, 'x': 307, 'width': 45, 'height': 42}, 'size': [0.12, 0.06296851574212893], 'pos': [0.8786666666666667, 0.4302848575712144], 'zOrders': {'local': 0, 'global': 0}, 'anchorPoint': [0.5, 0.5], 'visible': True}, 'parent': <poco.freezeui.hierarchy.Node object at 0x7fcfd82a9a58>}, {'name': 'Other', 'payload': {'label': None, 'type': 'Other', 'name': 'Other', 'rect': {'y': 281, 'x': 307, 'width': 1, 'height': 12}, 'size': [0.0026666666666666666, 0.017991004497751123], 'pos': [0.82, 0.4302848575712144], 'zOrders': {'local': 0, 'global': 0}, 'anchorPoint': [0.5, 0.5], 'visible': True}, 'parent': <poco.freezeui.hierarchy.Node object at 0x7fcfd82a9a58>}], 'parent': <poco.freezeui.hierarchy.Node object at 0x7fcfd82a9e48>}], 'parent': <poco.freezeui.hierarchy.Node object at 0x7fcfd82a9c18>}"." of "UIObjectProxy of "login_account_password_input""

Process finished with exit code 1

chen5079 avatar Nov 25 '20 05:11 chen5079

我也遇到了这个问题,set_text只能在Android上用,iOS不行

TinkZhang avatar Jan 19 '23 01:01 TinkZhang