'NEWMAN'에 해당되는 글 2건

Get your collection url

Collection > Share > Get pubilc link > Get public link 클릭 후 해당 URL 복사

 

 

Get Newman and run with command

newman run "url"

 

실행 화면

 

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

API Chaining Test 관련  (0) 2020.08.07
SOAP requests 구동  (0) 2020.08.07
Data Driven Testing 관련  (0) 2020.08.06
WORKSPACES 관리  (0) 2020.08.06
Newman 관련  (0) 2020.08.06
블로그 이미지

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

,

Newman 은 Postman의 Collection을 커맨드 라인에서 실행시켜준다!

 

 

전체적인 순서

1. Install node.js

2. Install newman

3. export collection and run from commandline

4. On cmd goto location of collection json file

5. Run command

 

 

check if node.js is already installed

cmd 창에서 아래와 같이 확인

node -v  
npm -v

 

 

1. Install node.js

만약 설치가 안되어있다면 아래 URL 참고하여 설치

https://nodejs.org/en/download/

 

Download | Node.js

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

nodejs.org

 

 

2. Install Newman

cmd 창에서 아래 명령어로 뉴맨 설치!

npm install -g newman

 

 

3. Export collection as json file

 

 

4. On cmd goto location of collection json file

5. Run command

예시 : newman run (exprot한 json 파일 명)

newman run collectionfilename.json

 

 

실행 화면

C:\Users\toast\Desktop\Postman>newman run Collection1.postman_collection.json
newman

Collection1

□ GET
└ GET User
  ┌
  │ 'Hello world...'
  │ 'Value for url variables is : https://reqres.in'
  │ 'POSTMAN'
  │ undefined
  └
  GET https://reqres.in/api/users/2  [200 OK, 1.08KB, 249ms]
  ┌
  │ 'Hello world...'
  │ 'Value for url variables is : https://reqres.in'
  │ 'POSTMAN'
  │ undefined
  └

└ GET UserList
  ┌
  │ 'Hello world...'
  │ 'Value for url variables is : https://reqres.in'
  │ 'POSTMAN'
  │ undefined
  └
  GET https://reqres.in/api/users?page=2 [200 OK, 1.78KB, 47ms]
  √  Verify Response time is less than 200ms
  √  Verify Status code is 200

└ ScriptsTest
  ┌
  │ 'Hello world...'
  │ 'Value for url variables is : https://reqres.in'
  │ 'POSTMAN'
  │ undefined
  └
  GET  [errored]
     runtime:extenstions~request: request url is empty

□ POST
└ User Registration
  ┌
  │ 'Hello world...'
  │ 'Value for url variables is : https://reqres.in'
  │ 'POSTMAN'
  │ undefined
  └
  GET  [errored]
     runtime:extenstions~request: request url is empty

┌─────────────────────────┬────────────────────┬────────────────────┐
│                         │           executed │             failed │
├─────────────────────────┼────────────────────┼────────────────────┤
│              iterations │                  1 │                  0 │
├─────────────────────────┼────────────────────┼────────────────────┤
│                requests │                  4 │                  2 │
├─────────────────────────┼────────────────────┼────────────────────┤
│            test-scripts │                  6 │                  0 │
├─────────────────────────┼────────────────────┼────────────────────┤
│      prerequest-scripts │                  5 │                  0 │
├─────────────────────────┼────────────────────┼────────────────────┤
│              assertions │                  2 │                  0 │
├─────────────────────────┴────────────────────┴────────────────────┤
│ total run duration: 729ms                                         │
├───────────────────────────────────────────────────────────────────┤
│ total data received: 1.58KB (approx)                              │
├───────────────────────────────────────────────────────────────────┤
│ average response time: 148ms [min: 47ms, max: 249ms, s.d.: 101ms] │
└───────────────────────────────────────────────────────────────────┘

  #  failure           detail

 1.  Error             runtime:extenstions~request: request url is empty
                       at request
                       inside "GET / ScriptsTest"

 2.  Error             runtime:extenstions~request: request url is empty
                       at request
                       inside "POST / User Registration"

 

 

Jenkins 활용 관련

아래와 같이 Newman 명령어로 JOB 생성하여 진행

 

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

Data Driven Testing 관련  (0) 2020.08.06
WORKSPACES 관리  (0) 2020.08.06
Tests 생성(Quick Scripts 활용)  (0) 2020.08.06
Environment 생성 및 활용  (0) 2020.08.06
VARIABLES 활용  (0) 2020.08.06
블로그 이미지

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

,