openatx / facebook-wda

Facebook WebDriverAgent Python Client Library (not official)
MIT License
1.72k stars 266 forks source link

ios真机上 在有些app上运行某些函数,会出现 requests.exceptions.ReadTimeout: HTTPConnectionPool(host='localhost', port=8100): Read timed out. (read timeout=60.0) 这样的报错 #68

Open 13409795771 opened 5 years ago

13409795771 commented 5 years ago
  1. 在某些ios第三方app上, 通过自己编写的py脚本调用这个函数 print driver.source() , 打印页面的数据结构的时候, 如下图所示: 4201562124736_ pic_hd

报如下的错误 : requests.exceptions.ReadTimeout: HTTPConnectionPool(host='localhost', port=8100): Read timed out. (read timeout=60.0)

  1. 而且我发现当通过py脚本打印页面数据结构的报错的时候。 我重新Product -> Test 重新启动WebDriverAgentRunner, 然后Safari 通过网页 localhost:8100/inspector ( 我已经通过 tcprelay.py -t 8100:8100 端口转发了 ), 也是发现页面进不去的 , 好像也是得不到页面的数据结构, 导致页面进不去似的

  2. 但是我发现我把手机网络断掉 , 上面的1,2 我阐述的问题 都解决了, print driver.source() 能够打印数据结构, 也能Safari 通过网页 localhost:8100/inspector 进去看到页面, 但是我手机开网络, 1,2 问题又会重现, 这是什么原因导致的呢? 希望大佬解惑下 感谢

我的猜想:

  1. 是不是因为在有网的时候, app自己本身有很多http请求, 导致会WebDriverAgent的http网络请求阻塞了呢