'WEB API Test'에 해당되는 글 15건

What is Environment?

Env is a set of key-value pairs

 

 

선행 작업

아래 URL 참고하여 POST Requset 생성

https://reqres.in/

 

Reqres - A hosted REST-API ready to respond to your AJAX requests

Native JavaScript If you've already got your own application entities, ie. "products", you can send them in the endpoint URL, like so: var xhr = new XMLHttpRequest(); xhr.open("GET", "https://reqres.in/api/products/3", true); xhr.onload = function(){ conso

reqres.in

 

Body 작업(아래 Json 형식의 데이터는 위의 페이지에서 확인)

{
	"email": "{{email}}",
	"password": "{{pasword}}"
}

 

 

Create Environment

MANAGE ENVIROMENTS > Add 클릭

 

 

Use Environment

변수 사용 예 : {{변수명}}

 

 

결과 콘솔 화면

 

'WEB API Test > Postman' 카테고리의 다른 글

Newman 관련  (0) 2020.08.06
Tests 생성(Quick Scripts 활용)  (0) 2020.08.06
VARIABLES 활용  (0) 2020.08.06
VARIABLES 생성  (0) 2020.08.06
Collection 구동  (0) 2020.08.06
블로그 이미지

정신차려이각박한세상속에서

,

사전 설정

settings 화면

 

 

How to get & set variables through scripts

[Test 탭 스크립트 작성]
[Pre-request 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
블로그 이미지

정신차려이각박한세상속에서

,

variables란?

elements(data store) that can take different values

 

사용하는 이유?

to reuse values at multiple places
avoid repetition
to avoid re-work when value changes

 

Create variables

Collection 안에 Variadbles 설정

 

Refer variables

예시 : {{변수명}}

 

 

'WEB API Test > Postman' 카테고리의 다른 글

Environment 생성 및 활용  (0) 2020.08.06
VARIABLES 활용  (0) 2020.08.06
Collection 구동  (0) 2020.08.06
Collection 생성  (0) 2020.08.06
Request 구동  (0) 2020.08.06
블로그 이미지

정신차려이각박한세상속에서

,

Create request

 

 

Run request

 

 

Collection Runner 창 확인

 

 

테스트를 위해 아래와 같이 세팅 후 Run Collection1 버튼 클릭

 

 

실행 완료 화면

 

'WEB API Test > Postman' 카테고리의 다른 글

VARIABLES 활용  (0) 2020.08.06
VARIABLES 생성  (0) 2020.08.06
Collection 생성  (0) 2020.08.06
Request 구동  (0) 2020.08.06
API Request 생성  (0) 2020.08.06
블로그 이미지

정신차려이각박한세상속에서

,

COLLECTION 이란?

Grouping requests in collections

 

 

Create Collection

아래와 같이 Collection을 생성할 수 있다.

 

생성된 화면

 

 

Create folders inside collection

collection 안에 아래처럼 폴더를 생성하여 세부 그룹을 지정할 수 있다

Share, Run은 다음에 설명

 

폴더 생성 확인

 

'WEB API Test > Postman' 카테고리의 다른 글

VARIABLES 활용  (0) 2020.08.06
VARIABLES 생성  (0) 2020.08.06
Collection 구동  (0) 2020.08.06
Request 구동  (0) 2020.08.06
API Request 생성  (0) 2020.08.06
블로그 이미지

정신차려이각박한세상속에서

,

테스트를 위해 아래의 홈페이지에서 샘플 API data를 참고하자

https://reqres.in/

 

Reqres - A hosted REST-API ready to respond to your AJAX requests

Native JavaScript If you've already got your own application entities, ie. "products", you can send them in the endpoint URL, like so: var xhr = new XMLHttpRequest(); xhr.open("GET", "https://reqres.in/api/products/3", true); xhr.onload = function(){ conso

reqres.in

 

아래로 스크롤을 내려 리퀘스트 URL 획득

 

 

이전에 생성한 리퀘스트에 해당 URL을 입력하여 구동하자

위와 같이 성공한 화면(응답 값)을 확인할 수 있다

 

 

아래와 같이 이벤트 별로 응답시간을 확인할 수 있음

 

'WEB API Test > Postman' 카테고리의 다른 글

VARIABLES 활용  (0) 2020.08.06
VARIABLES 생성  (0) 2020.08.06
Collection 구동  (0) 2020.08.06
Collection 생성  (0) 2020.08.06
API Request 생성  (0) 2020.08.06
블로그 이미지

정신차려이각박한세상속에서

,

Create Workspace

 

 

Create New Request

 

 

Create Collection

 

 

생성 된 화면

'WEB API Test > Postman' 카테고리의 다른 글

VARIABLES 활용  (0) 2020.08.06
VARIABLES 생성  (0) 2020.08.06
Collection 구동  (0) 2020.08.06
Collection 생성  (0) 2020.08.06
Request 구동  (0) 2020.08.06
블로그 이미지

정신차려이각박한세상속에서

,