{"action":"opened","issue":{"url":"https://api.github.com/repos/AirtestProject/Poco/issues/43","repository_url":"https://api.github.com/repos/AirtestProject/Poco","labels_url":"https://api.github.com/repos/AirtestProject/Poco/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/AirtestProject/Poco/issues/43/comments","events_url":"https://api.github.com/repos/AirtestProject/Poco/issues/43/events","html_url":"https://github.com/AirtestProject/Poco/issues/43","id":338504711,"node_id":"MDU6SXNzdWUzMzg1MDQ3MTE=","number":43,"title":"运行poco().click报错， 但是单独在airtest跑这段语句正常","user":{"login":"kagamimoe","id":2004606,"node_id":"MDQ6VXNlcjIwMDQ2MDY=","avatar_url":"https://avatars2.githubusercontent.com/u/2004606?v=4","gravatar_id":"","url":"https://api.github.com/users/kagamimoe","html_url":"https://github.com/kagamimoe","followers_url":"https://api.github.com/users/kagamimoe/followers","following_url":"https://api.github.com/users/kagamimoe/following{/other_user}","gists_url":"https://api.github.com/users/kagamimoe/gists{/gist_id}","starred_url":"https://api.github.com/users/kagamimoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kagamimoe/subscriptions","organizations_url":"https://api.github.com/users/kagamimoe/orgs","repos_url":"https://api.github.com/users/kagamimoe/repos","events_url":"https://api.github.com/users/kagamimoe/events{/privacy}","received_events_url":"https://api.github.com/users/kagamimoe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-05T09:54:29Z","updated_at":"2018-07-05T09:54:29Z","closed_at":null,"author_association":"NONE","body":"报错信息：\r\nError\r\nTraceback (most recent call last):\r\n  File \"C:\\sgame\\scripts\\test002.py\", line 31, in test_change_name\r\n    poco(\"imgHead\").click()\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\proxy.py\", line 23, in wrapped\r\n    return func(proxy, *args, **kwargs)\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\proxy.py\", line 283, in click\r\n    pos_in_percentage = self.get_position(focus)\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\proxy.py\", line 499, in get_position\r\n    pos = self.attr('pos')\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\proxy.py\", line 39, in wrapped\r\n    return func(self, *args, **kwargs)\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\proxy.py\", line 620, in attr\r\n    nodes = self._do_query(multiple=False)\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\proxy.py\", line 755, in _do_query\r\n    self._nodes = self.poco.agent.hierarchy.select(self.query, multiple)\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\freezeui\\hierarchy.py\", line 89, in select\r\n    return self.selector.select(query, multiple)\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\sdk\\Selector.py\", line 77, in select\r\n    return self.selectImpl(cond, multiple, self.getRoot(), 9999, True, True)\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\sdk\\Selector.py\", line 70, in getRoot\r\n    return self.dumper.getRoot()\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\freezeui\\hierarchy.py\", line 35, in getRoot\r\n    root = Node(self.dumpHierarchy())\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\utils\\simplerpc\\utils.py\", line 13, in new_func\r\n    ret, err = cb.wait(timeout=30)\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\utils\\simplerpc\\simplerpc.py\", line 72, in wait\r\n    self.agent.update()\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\utils\\simplerpc\\rpcclient.py\", line 61, in update\r\n    data = self.conn.recv()\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\utils\\simplerpc\\transport\\tcp\\main.py\", line 32, in recv\r\n    msg_bytes = self.c.recv()\r\n  File \"C:\\Python27\\lib\\site-packages\\poco\\utils\\simplerpc\\transport\\tcp\\safetcp.py\", line 39, in recv\r\n    trunk = self.sock.recv(size)\r\nerror: [Errno 10053] \r\n\r\n下面是代码：\r\n\r\n```\r\ndevice = connect_device(\"Android:///\")\r\npoco = StdPoco(15004, device)\r\n\r\nclass test002(unittest.TestCase):\r\n\r\n    def setUp(self):\r\n        print \"开始启动游戏\"\r\n        normal_start()\r\n\r\n    def test_change_name(self):\r\n        sleep(10.0)\r\n        # open_setting_panel()\r\n        if poco(\"imgHead\").exists:\r\n            print(\"点击设置按钮\")\r\n            poco(\"imgHead\").click()\r\n            sleep(2.0)\r\n   def tearDown(self):\r\n        print \"执行完毕了，现在关闭游戏\"\r\n        normal_exit()\r\n\r\nif __name__ == '__main__':\r\n    unittest.main()\r\n\r\n```\r\n\r\n\r\n但是单独在airtestIDE里 ，运行这段报错代码是正常的 。\r\n\r\n```\r\nif poco(\"imgHead\").exists:\r\n            print(\"点击设置按钮\")\r\n            poco(\"imgHead\").click()\r\n            sleep(2.0)\r\n```\r\n\r\n"}}
{"actor":{"display_login":"kagamimoe"}}