POSTMAN接口测试工具介绍

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u011466469/article/details/78352298
1、 Postman是一款功能强大的HTTP调试与模拟插件。(Chrome浏览器专属插件)
2、官网 https://www.getpostman.com/ 下载对应操作系统的 postman版本,并解压;
3、打开Chrome浏览器--设置--加载已解压的扩展程序...
4、点击启用插件,弹出postman界面,注册账号:xuping2012/xuping_2012

5、登录postman界面,它几乎满足所有接口请求的方法,输入url,设置固定header【Content-Type:application/x-www-form-urlencoded】

6、如果url自带所有参数请求 https://www.testing.com/login?loginName=132*****5340&loginPwd=111111,直接点击send即可:

7、在url后面也可以点击Params参数,增减传递参数,留下关键参数,点击send即可:

8、post方法请求接口,url不带参数,在body选择传参方式,选择x-www-form-urlencoded,输入参数:

9、关键学会postman模拟接口测试插件,适用fiddler抓取数据包(不会利用fiddler抓取jmeter接口请求的数据包):

10、postman同样强大的jmeter提供了断言功能:

断言格式代码:

11、Postman Intercepter使用方法
1.在Postman工具中打开postman Intercepter功能:

2. 如果只需要测试特定网站,可以在 postman interceptor插件中设置 Filter requests。
Filter requests默认是“.*”,表示捕获所有的网站。如果只想要捕获百度,可以在Filter requests里输入“baidu”。

3. 在chrome中进行操作,比如打开百度,然后搜索关键字“hello”,然后点击“百度一下”。
4. 打开 postman interceptor。可以看到 “last 10 requests“。
5. 打开Postman,可以看到“History”显示chrome中进行的操作。

6. 然后就可以在Postman对 request进行修改,过滤,以及编写测试用例。
7.可以新增collections文件,把监听收集到的接口save保存到新建的文件夹。
tips:Intercepter,就相当于代理(其实并不是),插件,需要在chrome开启,并打开postman的Intercepter开关,拦截浏览器请求接口

猜你喜欢

转载自blog.csdn.net/u011466469/article/details/78352298