手机是 wifi 连接方式,跑 appium 自动化时,获取元素失败,返回 500 错误,错误信息如下:
[HTTP] --> POST /wd/hub/session/4b6d9cdd-dae0-4e2a-b560-66a6f191d820/element {"using":"id","sessionId":"4b6d9cdd-dae0-4e2a-b560-66a6f191d820","value":"com.example.testdemo:id/edittet"}

[HTTP] <-- POST /wd/hub/session/4b6d9cdd-dae0-4e2a-b560-66a6f191d820/element 500 93861 ms - 164

和正常获取元素的 log 相比,还没执行到如下代码,还没到函数体,就处理失败了,但是用有线连接不存在这个问题,很疑惑咋解
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: ["id","com.example.testdemo:id/edittet","255ab141-5680-4f65-91a2-90734e94dff3"]

正常 log 如下:
[HTTP] --> POST /wd/hub/session/255ab141-5680-4f65-91a2-90734e94dff3/element {"using":"id","sessionId":"255ab141-5680-4f65-91a2-90734e94dff3","value":"com.example.testdemo:id/edittet"}

[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: ["id","com.example.testdemo:id/edittet","255ab141-5680-4f65-91a2-90734e94dff3"]

[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.example.testdemo:id/edittet","context":"","multiple":false}}


↙↙↙阅读原文可查看相关链接,并与作者交流