![](/img/trans.png)
[英]Postman : How to run some request multiple times and others single time using Postman or Newman
[英]Export CSV of a particular request in Postman using Newman
我有一個Postman請求的JSON集合。 我通過紐曼運行它。 有沒有一種方法可以使用newman或postman將特定請求(不是全部)的XML響應導出到文件中
謝謝
據我所知,沒有為紐曼開發的XML報告程序。 快速解決問題的最簡單,最簡單的方法是將響應解析添加到某些請求或集合中(如果需要全部)
在測試中,您可以添加:
let responseJSON = JSON.parse(responseBody)
tests["Status code is 200"] = responseCode.code === 200;
if(responseCode.code !== 200)
{
console.log(responseJSON);
return;
}
要么
try {
var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("jwt_token", jsonData.data.token);
} catch (err) {
console.log(err);
}
或者,如果您不需要僅在發生錯誤后輸出它,則只需輸入:
var body = JSON.parse(responseBody)
console.log(body);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.