AirtestProject / AirtestProject/Poco

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

Đang mở
#424 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
2k
Fork
341
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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("1650@qq.com")
text("1650@qq.com")

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__': }], '__parent__': }, {'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__': }, {'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__': }], '__parent__': }], '__parent__': }"." of "UIObjectProxy of "login_account_password_input""

Process finished with exit code 1

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.