API Chaining Test 란?
Get data from response of one API and refer in another API
Add requests in Postman and Use env variables to parameterize the value to be referred
아래와 같이 Collection, environment, Request 생성
Add scripts to fetch value from response of 1st API
bodyData = JSON.parse(responseBody)
value = bodyData.data[2].first_name
console.log(value)
pm.environment.set("Username1", value);
여기서 "value = bodyData.data[2].first_name" 이 부분은 아래를 통해 참고하였다.
[JSONPath Finder 관련]
확장 프로그램 실행 후 해당 JSON 데이터를 넣으면 아래와 같이 JSONPath를 찾을 수 있다.
Update the fetched value in env variables
Run and validate
아래와 같이 Variables 와 "UpdateUser" Request도 체인으로 업데이트 동작을 확인할 수 있다.
'WEB API Test > Postman' 카테고리의 다른 글
API Authorization 관련 (0) | 2020.08.07 |
---|---|
SOAP requests 구동 (0) | 2020.08.07 |
Collection 원격 구동 with URL (0) | 2020.08.06 |
Data Driven Testing 관련 (0) | 2020.08.06 |
WORKSPACES 관리 (0) | 2020.08.06 |