FAutoTest/docs/APPENDIX.md

38 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Appendix
Chrome调试协议[Chrome Debugging Protocol]([*https://chromedevtools.github.io/devtools-protocol/)是Blink内核支持的调试协议Chrome以及微信使用的QQ X5浏览器内核均在Blink基础上开发Chrome F12以及常用的调试工具也是基于Chrome调试协议基础上开发。
### Chrome 调试协议格式
* **请求**
.<img src="images/chromeQuest.png" width="250" style="float:left"/>
> 1. Id未使用对于一次操作来说请求id=响应idid只是用来区分当前请求对应的响应
> 2. Method要执行的操作参见下面的模块域
> 3. Params执行操作传递的参数具体参见协议文档
* **响应**
.<img src="images/chromeResponse.png" width="250" style="float:left"/>
> 1. Id与请求id相同
> 2. Result执行结果
* **模块域**
Google把要执行的操作按不同的功能模块域[domains](https://chromedevtools.github.io/debugger-protocol-viewer/1-2/))划分,以在页面上弹框为例:
Js弹窗操作对应Runtime域中Runtime.evaluate方法
<img src="images/chromeRuntime.png" width="600" style="float:left"/>
其中**发送请求**为:
<img src="images/appendixRuntimeSend.png" width="400" style="float:left"/>.
**响应:**
<img src="images/appendixRuntimeResponse.png" width="380" style="float:left"/>.