Skip to content

Instantly share code, notes, and snippets.

@sivaprabug
Created July 5, 2017 10:23
Show Gist options
  • Save sivaprabug/65dfea22719d220539fdb4f287d6c5c3 to your computer and use it in GitHub Desktop.
Save sivaprabug/65dfea22719d220539fdb4f287d6c5c3 to your computer and use it in GitHub Desktop.

Revisions

  1. Sivaprabu Ganesan created this gist Jul 5, 2017.
    11 changes: 11 additions & 0 deletions postman.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    tests["Status code is 200"] = responseCode.code === 200;

    // getting CSRF token value from responseBody and stored in global variable
    var data = JSON.parse(responseBody);
    console.info("CSRF Token Value = " + data.CSRFToken);
    postman.setGlobalVariable("csrftoken", data.CSRFToken);

    // getting QSESSIONID value from Cookie and stored in global variable
    var qsessionidValue = postman.getResponseCookie("QSESSIONID").value
    console.log(qsessionidValue);
    postman.setGlobalVariable("QSESSIONID", qsessionidValue);