接口測試工具postman安裝及使用

目前的postman插件如果想正常使用,必須安裝Postman Interceptor插件,這樣才能直接使用chrome瀏覽器的cookie等信息,否則postman是無法完成老版本的功能的。

直接使用chrome appstore安裝是沒有問題的,但是如果是離線安裝,那麼問題來了,發現postman總是無法識別postman interceptor插件。 
下載chrome最新插件的地址如下

https://www.crx4chrome.com/extensions/

 

根據插件的id就可以搜索,十分方便。

下載的版本如下:

aicmkgpgakddgnaphhhpliifpcfhicfo-0.2.20-Crx4Chrome.com.crx

fhbjgbiflinjbdggehcddcbncdddomop-4.10.3-Crx4Chrome.com.crx

百度網盤 https://pan.baidu.com/s/1PoZNPfb1rFtgDkZAfzFgwQ  密碼:pqk4


離線安裝方法很簡單,修改後綴名爲rar(或zip),然後解壓到一個目錄中,修改_metadata爲metadata(去掉下劃線)。這樣才能安裝成功,否則報錯(根據提示信息,也可以修改該問題)。

接着,打開chrome,然後打開擴展程序,勾選開發者模式,選擇加載已經解壓的擴展程序,選擇插件的解壓目錄,就可以安裝了。

 

此時,如果打開postman,開啓interceptor插件,是無法成哦功能的,提示去下載該插件(但是我已經明明安裝了啊。),

經過嘗試,發現需要修改postman安裝包中js/requester.js 和runner.js ,Ctrl+F搜索其中的postman_interceptor_idpostman-interceptor_id字段需要將其中的內容字符串字符串替換成擴展程序界面的Interceptor的id(記住務必都要替換,否則少替換都不會成功),如下圖所示:

每個人,每次安裝這個id都不一樣,所以需要自己去複製,切記。

 

我的id是

dadamddfbngjafhgcmnbhnaekcipphfl

替換完成之後,在擴展程序中,重新加載postman插件,然後,再次點擊開啓Interceptor的圖標,就會成爲高亮狀態。

到此就可以使用postman的完成功能了。



安裝postman時出現以下警告:
Ignored insecure CSP value "https://ssl.google-analytics.com/ga.js" in directive 'script-src'.

查詢一下可知,這是用於訪問統計的,應該沒什麼大用。,可以考慮找到直接去掉引用。

自己嘗試找到的解決辦法:

找到解壓後的根目錄下的 manifest.json,打開找到sandbox節點
 "sandbox": {      "pages": ["html/tester_sandbox.html", "snippet_sandbox.html"],      "content_security_policy": "sandbox allow-scripts allow-popups; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com/ga.js;"
    }
可以看到最後就是報錯的那個js,直接刪除鏈接接好了,改完之後如下所示
 "sandbox": {      "pages": ["html/tester_sandbox.html", "snippet_sandbox.html"],      "content_security_policy": "sandbox allow-scripts allow-popups; script-src 'self' 'unsafe-inline' 'unsafe-eval' "
    }

這時候在chrome裏面刷新一下,可以看到已經不報錯了。


blob.png




最強PostMan使用教程(1) 

http://blog.csdn.net/u013613428/article/details/51557804

最強PostMan使用教程(2) - 在test suite中運行test case 

http://blog.csdn.net/u013613428/article/details/51557914

 Postman使用小技巧 - 用Postman生成Request代碼 

http://blog.csdn.net/u013613428/article/details/51577209

最強PostMan使用教程(2) - 在test suite中運行test case 

http://blog.csdn.net/u013613428/article/details/51557914



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章