Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable Postman's Newman verbose output? (to show request's body)

Tags:

postman

When running a collection test with Newman, I'd like it to display the request body sent, to have a more detailed record of the test (and making sure the environment variables were replaced correctly).

I checked the Newman command line options at the project documentation and found nothing, and the -O option described in this old issue is not working.

I'd like to know how to activate the verbose output.

like image 569
nacho_dh Avatar asked May 11 '17 19:05

nacho_dh


2 Answers

This is a popular feature request that has been documented at GitHub here

As a workaround, you can add this to the post-request each test you want to log:

tests["[INFO] Request: " + JSON.stringify(request)] = true;
tests["[INFO] Response: " + responseBody] = true;
like image 141
Veener Avatar answered Oct 22 '22 10:10

Veener


try the --verbose option. This is an example output:

GET http://myapp:8080/b/api/v1/0 
 
  401 Unauthorized ★ 59ms time ★ 290B↑ 367B↓ size ★ 8↑ 5↓ headers ★ 0 cookies
  ┌ ↓ application/json ★ text ★ json ★ utf8 ★ 193B
  │ {"path":"http://myapp:8080/b/api/v1/0","message":"401 Unauthorized from POST http:
  │ //myotherapp:8080/v1/auth/user","timestamp":"2022-03-23
  │ T10:11:31.133683","status":401}
  └
  prepare   wait    dns-lookup   tcp-handshake   transfer-start   download   process   total 
  1ms       284µs   (cache)      (cache)         56ms             1ms        51µs      59ms
like image 1
Yair Kukielka Avatar answered Oct 22 '22 09:10

Yair Kukielka