Appium 手机是 wifi 连接方式,跑 appium 自动化时,获取元素失败,返回 500 错误

Wang · 2017年10月27日 · 最后由 余good' 回复于 2021年02月02日 · 2457 次阅读

手机是 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}}

共收到 1 条回复 时间 点赞

同样遇到了这个问题,楼主这个问题解决了嘛

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册