Postman.setNextRequest() unable to pass request id

我怕爱的太早我们不能终老 提交于 2019-12-13 03:27:21

问题


I wrote a script in the test tab to set an access token from the login request. After setting access token I want to call logout API to revoke my session or access token.

I have mentioned .setNextRequest("Requestname" i.e logout) and logout request also included in that folder.

When I run all the folders in the collection runner, I get success to call login request and set access token but my .setNextRequest() method is not working where I am passing the request name.

If we have to pass request ID then I am unable to identify request ID within that folder. Any useful suggestion would be appreciated.

Here is my script in the test tab of the login request.

var Jasondata = JSON.parse(responseBody);
var accessToken = Jasondata.payload.accessToken;
console.log(accessToken);

pm.environment.set("accessToken", accessToken);
postman.setNextRequest("7");

来源:https://stackoverflow.com/questions/57609395/postman-setnextrequest-unable-to-pass-request-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!