【测试小工具分享】将Charles抓包文件导出到postman客户端脚本
- 2019 年 12 月 5 日
- 筆記
Charles2Postman可以帮助你,批量将Charles导出的抓包请求响应数据文件,快速转成支持导入postman格式,让你在没有restful API设计文档情况下,快速构建postman客户端请求脚本,无需再一个个参数复制粘贴,节省时间。
一、github地址:
https://github.com/liyinchigithub/Charles2Postman
二、环境要求:
1、安装Nodejs
下载地址:https://nodejs.org/en/
2、安装Git客户端,用于拉取github工程
三、初始化及配置
1、工程获取
git clone [email protected]:liyinchigithub/Charles2Postman.git
2、进入目录下
cd charles2postman
3、首次安装依赖
npm install
四、如何使用Charles导出抓包数据文件
1、打开Charles

2、选中请求,右击导出

3、导出格式为JSON Session File(.chlsj)

4、将导出的文件,保存于在Charles2Postman的File文件夹下

五、如何进行转换
1、方式一
双击run.bat文件,即可完成转换。

2、方式二(命令行)
node index.js

3、转换后文件输出位置
./outputFile/postman_collection.json

4、将postman_collection.json导入postman中

5、最终效果

