我們在開發和調試網絡程式或是基于B/S模式的系統的時候,往往需要借助一些網絡請求工具來監視或測試接口,如我常用的Firebug。但是在我們自動化API測試和多樣化API接口的開發環境中,就需要一款好用的API自動化測試工具。PostMan就是一款這樣的接口調試測試利器。PostMan以前是以Chrome版本提供的,現在官方已經不在維護Chrome版本了,是以我們現在可以使用Native版本。下面我就簡單介紹下這塊工具的使用。
下載下傳安裝
官方下載下傳位址:https://www.postman.com/downloads/
Postman支援Windows,MAC,Linux系統
下載下傳後,一路按提示安裝完成,Postman安裝完成自動運作,界面如下
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 Postman啟動界面
使用Postman需要先申請一個賬号,然後登入,登入後界面如下:
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 Postman主界面
界面介紹
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 Postman操作界面
發生請求後,可以檢視相關傳回狀态,執行事件,傳回檔案大小,Cookies,Headers等
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 Postman還可以根據傳回資訊類型,自動格式化傳回Body格式
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 測試接口參數和資料設定
1、Params:及URL後面帶的參數
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 2、Authorization:接口相關認證相關資訊
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 3、Headers:請求頭部參數
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 4、Body:請求送出的資料
表單請求資料:
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 表單請求資料
JSON等其他資料格式送出
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 二進制檔案送出
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 針對接口,批量測試
我們先向某個集合批量添加測試接口
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 然後我們點選運作
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 打開如下視窗
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 點選運作,獲得測試結果
AppScan api登入接口 postman_Postman的使用和介紹下載下傳安裝界面介紹測試接口參數和資料設定針對接口,批量測試 好了,Postman基礎使用就介紹到這,當然Postman的功能不止這些,後面有時間再介紹。