三、 设置断点
2020-02-13 本文已影响0人
supermanto

前言
在软件测试的工作中,遇到过这样一个场景:

答案:可以对后台接口进行测试,也可以使用Fiddle的断点功能
1 全局断点
全局断点:默认会对所有请求进行拦截
导航栏Rules->Automatic Breakpoints ->之后有两个选项:Before Requests、After Responses。

这两个选项都可以设置断点,但是有什么不同呢,下面为大家介绍:
(1)Before Requests :在请求发送到服务器之前打断点,可以调整发送的参数;
对请求信息进行拦截:

实战图例:

(2)After Responses :响应给客户端之前打断点,可以调整返回过来的数据;
修改响应信息:

实战图例:

两者断点的位置不一样,所以能够修改的数据不一样,大家可以根据目己的需求选择不同的断点方式。
2 局部断点
局部断点:只对指定的请求进行拦截
(1)bpu:请求时断点,比如 bpu / sdk,类似于Before Requests
举个例子:
要对指定的请求拦截,可以右击该请求复制url:

设置断点:

取消断点:

(2)bpafter:响应时断点,比如 bpafter / sdk,类似于After Requests(具体使用参照bpu命令)