사전 설정
How to get & set variables through scripts
console.log("Hello world...");
let urlVar = pm.variables.get("url");
console.log("Value for url variables is : "+urlVar);
pm.variables.set("name", "POSTMAN");
console.log(pm.variables.get("name"));
let globalVar = pm.globals.get("Env");
console.log(globalVar);
관련 스크립트 방법은 아래 URL 참고
https://learning.postman.com/docs/writing-scripts/script-references/test-examples/
Home
Postman Learning Center Learn how to use Postman effectively in your API projects. Check out the docs and support resources! Explore the docs
learning.postman.com
실행 후 콘솔 화면
'WEB API Test > Postman' 카테고리의 다른 글
Tests 생성(Quick Scripts 활용) (0) | 2020.08.06 |
---|---|
Environment 생성 및 활용 (0) | 2020.08.06 |
VARIABLES 생성 (0) | 2020.08.06 |
Collection 구동 (0) | 2020.08.06 |
Collection 생성 (0) | 2020.08.06 |