当前位置:网站首页>技术分享 | 接口测试常用代理工具
技术分享 | 接口测试常用代理工具
2022-07-28 05:28:00 【叶赫那拉 赫敏】
在接口测试中,有各种功能强大的代理工具,比如 Charles 、 Burpsuite 、 mitmproxy 等等。这些代理工具可以帮助我们构造各种测试场景、以及更好的完成测试工作。下面的介绍以 Charles 为主。
Charles
Charles 是一款代理服务器,可以截取请求和响应达到分析抓包的目的,且支持多平台,能够在 Windows,Mac,Linux 上使用。
界面和基本设置
Charles 上边是菜单栏,左边记录了访问过的每个网站/主机,右侧显示信息细节。

session
Charles 可以存储各种网络请求信息,所有的请求和响应都会记录到 session 中,可以进行检查和分析。打开菜单栏中的File,在这里管理 session,包括新建、打开、清空等等。

注意:每次启动 Charles,都会自动创建一个新的 session
也可以关闭记录,如果关闭记录,Charles 会正常通过所有请求,但它们不会记录在 session 中,点击下面来关闭记录:

Chart
Chart 记录了资源的生命周期,从请求到等待到响应请求。它还将相关资源分组,比如下面的 4 个 Resource 是一组:

SSL
利用 Chart,可以知道请求的花费时间。
Charles 有自己的证书,称之为:Charles Root Certificate,在抓取数据时,可能收到有关证书警告,需要点击信任,下面设置可以手动设置证书:
信任 Charles Root Certificate:
Charlse 是中间工具,替浏览器查看服务器的证书并签名,但同时会把自己的证书发给浏览器,因此会出现警告,需要添加到信任序列才能正常使用,下面是工作图:

弱网测试
软件通常会受网络影响,网络差的时候会出现卡顿甚至 error。Charles 自带弱网工具,可以模拟弱网环境,在 Proxy->Throttle Settings 下,使用前要勾选 Enable Throttling。
如果想指定网站,可以勾选下 Only for selected hosts,然后在对话框的下半部分设置中设置 hosts 项。

Throttle Preset:选择网络类型,比如选择 56 kbps modem
Bandwidth:带宽
Utilistation:利用百分比
Round-trip:往返延迟
边栏推荐
- Brief analysis of order transaction
- 进程和线程的区别
- Water bottle effect production
- 如何描述一个BUG以及BUG级别的定义、生命周期
- JS reverse question 100 - question 1
- Water drop effect on umbrella
- Redis implementation of distributed lock and analysis of the main process of redismission distributed lock
- mysql索引优化
- SSAO by computer shader (II)
- 战疫杯--我的账本
猜你喜欢

Analysis of the semaphore source code of AQS

NIO示例

Graphic pipeline foundation (I)

项目编译NoSuch***Error问题

prometheus监控nacos

Valgrind tool

Leetcode brush question diary sword finger offer II 053. Medium order successor in binary search tree

Leetcode brush questions diary sword finger offer II 047. Binary tree pruning

Everything you don't know about time complexity is here

雨伞上的水滴效果
随机推荐
数组转链表
Leetcode brush question diary sword finger offer II 053. Medium order successor in binary search tree
ZOJ Problem 1005 jugs
设计测试用例的方法
Optimization ideas from ordinary query commodities to highly concurrent query commodities
Graphic pipeline foundation (part outside)
Analysis of reentrantlock source code of AQS
Personal understanding of Chinese remainder theorem
Network communication and tcp/ip protocol
Lancher deployment practice
js 变量等于0也等也' '问题
中国剩余定理 个人理解
Implementation of simple address book in [c language]
SSAO By Computer Shader(一)
SSAO by computer shader (III)
TCP/IP五层模型
Yapi vulnerability hanging horse program chongfu.sh processing
Code neatness (2)
JS variable is equal to 0, etc. '
软件开发中常见模型