alibaba / macaca

Automation solution for multi-platform. 多端自动化解决方案
https://macacajs.github.io
MIT License
3.17k stars 418 forks source link

用例运行失败后重试导致手机重启 #657

Open laiyuncong8404 opened 7 years ago

laiyuncong8404 commented 7 years ago
qichuan commented 6 years ago

@laiyuncong8404 I could not reproduce this issue, can you please try other phones and see if the reboot issue happen on them as well?

laiyuncong8404 commented 6 years ago

This issue does no longer exist, but i get another issue. send_keys method doesn't work as expected.

Appium Log

>> responseHandler.js:11:12 [master] pid:4174 Recieve HTTP Request from Client[2017-10-27 10:26:08]: method: POST url: /wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element, jsonBody: {"using":"name","value":"Subscribe"}
>> proxy.js:55:14 [master] pid:4174 Proxy: /wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element:POST to http://127.0.0.1:9008/wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element:POST with body: {"using":"name","value":"Subscribe"}
>> proxy.js:85:20 [master] pid:4174 Got response with status 200: {"sessionId":null,"status":0,"value":{"ELEMENT":"1"}}
>> session.js:109:14 [master] pid:4174 Send HTTP Respone to Client[2017-10-27 10:26:09]: {"sessionId":null,"status":0,"value":"{\"ELEMENT\":\"1\"}"}
>> responseHandler.js:11:12 [master] pid:4174 Recieve HTTP Request from Client[2017-10-27 10:26:09]: method: GET url: /wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element/1/displayed, jsonBody: {}
>> proxy.js:55:14 [master] pid:4174 Proxy: /wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element/1/displayed:GET to http://127.0.0.1:9008/wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element/1/displayed:GET with body: {}
>> proxy.js:85:20 [master] pid:4174 Got response with status 200: {"sessionId":"40f3dadb-a5b3-4381-a866-304470db7773","status":0,"value":true}
>> session.js:109:14 [master] pid:4174 Send HTTP Respone to Client[2017-10-27 10:26:09]: {"sessionId":"40f3dadb-a5b3-4381-a866-304470db7773","status":0,"value":"true"}
>> responseHandler.js:11:12 [master] pid:4174 Recieve HTTP Request from Client[2017-10-27 10:26:09]: method: POST url: /wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element/1/click, jsonBody: {}
>> proxy.js:55:14 [master] pid:4174 Proxy: /wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element/1/click:POST to http://127.0.0.1:9008/wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element/1/click:POST with body: {}
>> proxy.js:85:20 [master] pid:4174 Got response with status 200: {"sessionId":"40f3dadb-a5b3-4381-a866-304470db7773","status":0}
>> session.js:109:14 [master] pid:4174 Send HTTP Respone to Client[2017-10-27 10:26:09]: {"sessionId":"40f3dadb-a5b3-4381-a866-304470db7773","status":0}
>> responseHandler.js:11:12 [master] pid:4174 Recieve HTTP Request from Client[2017-10-27 10:26:09]: method: POST url: /wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element, jsonBody: {"using":"id","value":"io.emqtt.sample:id/topic"}
>> proxy.js:55:14 [master] pid:4174 Proxy: /wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element:POST to http://127.0.0.1:9008/wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element:POST with body: {"using":"id","value":"io.emqtt.sample:id/topic"}
>> proxy.js:85:20 [master] pid:4174 Got response with status 200: {"sessionId":"40f3dadb-a5b3-4381-a866-304470db7773","status":0,"value":{"ELEMENT":"1"}}
>> session.js:109:14 [master] pid:4174 Send HTTP Respone to Client[2017-10-27 10:26:10]: {"sessionId":"40f3dadb-a5b3-4381-a866-304470db7773","status":0,"value":"{\"ELEMENT\":\"1\"}"}
>> responseHandler.js:11:12 [master] pid:4174 Recieve HTTP Request from Client[2017-10-27 10:26:10]: method: POST url: /wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element/1/value, jsonBody: {"value":["encyclopedia/#"]}
>> proxy.js:55:14 [master] pid:4174 Proxy: /wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element/1/value:POST to http://127.0.0.1:9008/wd/hub/session/40f3dadb-a5b3-4381-a866-304470db7773/element/1/value:POST with body: {"value":["encyclopedia/#"]}
>> proxy.js:85:20 [master] pid:4174 Got response with status 200: {"sessionId":"40f3dadb-a5b3-4381-a866-304470db7773","status":13,"value":"An unknown server-side error occurred while processing the command."}
>> session.js:109:14 [master] pid:4174 Send HTTP Respone to Client[2017-10-27 10:26:10]: {"sessionId":"40f3dadb-a5b3-4381-a866-304470db7773","status":13,"value":"\"An unknown server-side error occurred while processing the command.\""}

Python Log

Traceback (most recent call last):
  File "MQTT.test.py", line 75, in test_01_sub
    .send_keys('encyclopedia/#')
  File "/Users/xiaoxue/Library/Python/2.7/lib/python/site-packages/macaca/util.py", line 145, in fluent_interface
    ret = func(instance, *args, **kwargs)
  File "/Users/xiaoxue/Library/Python/2.7/lib/python/site-packages/macaca/webelement.py", line 435, in send_keys
    'value': value_to_key_strokes(value)})
  File "/Users/xiaoxue/Library/Python/2.7/lib/python/site-packages/macaca/webelement.py", line 60, in _execute
    return self._driver._execute(command, data, unpack)
  File "/Users/xiaoxue/Library/Python/2.7/lib/python/site-packages/macaca/webdriver.py", line 68, in _execute
    ret.raise_for_status()
  File "/Users/xiaoxue/Library/Python/2.7/lib/python/site-packages/macaca/webdriverresult.py", line 54, in raise_for_status
    raise WebDriverException(error, message, screen, stacktrace)
WebDriverException:
Error: WebDriverError.UNKNOWN_ERROR
Message: None
njf1107 commented 6 years ago

我也遇到一样的问题