最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - postman setNextRequest not executing - Stack Overflow

programmeradmin2浏览0评论

I have this postman logic:

var returnData = JSON.parse(responseBody);
tests["status code"] = (responseCode.code === 401);
if (responseCode.code === 401) {
    postman.setNextRequest("get token with good login");
}

Even though status code is 401, that "setNextRequest" never get executed.
I am new to postman so maybe I am making a mistake somewhere?

Appreciate any pointer as to how I can chain this test and have it go onto to the next one?

thanks

-vincent

I have this postman logic:

var returnData = JSON.parse(responseBody);
tests["status code"] = (responseCode.code === 401);
if (responseCode.code === 401) {
    postman.setNextRequest("get token with good login");
}

Even though status code is 401, that "setNextRequest" never get executed.
I am new to postman so maybe I am making a mistake somewhere?

Appreciate any pointer as to how I can chain this test and have it go onto to the next one?

thanks

-vincent

Share Improve this question asked Oct 12, 2016 at 17:36 Vince YauVince Yau 5551 gold badge5 silver badges17 bronze badges 2
  • Is the API working if you use POSTMAN plugin? – Ali Gajani Commented Oct 12, 2016 at 18:22
  • Thanks for your reply. I am using Chrome app version. Is that the plugin that you are referring to? – Vince Yau Commented Oct 12, 2016 at 18:26
Add a comment  | 

1 Answer 1

Reset to default 23

I figured out what's wrong. I need to run the sequences in "Runner". I was merely pressing "Send" beforehand.
Thanks for your reply.

发布评论

评论列表(0)

  1. 暂无评论