2
votes

im using windows 10 and configured my Jenkins to perform build for Postman (Newman) collection i received Finished: SUCCESS but in the console for that build i see gibberish data instead of Newman table results:

Started by user admin Building in workspace C:\Users\amir.jenkins\workspace\Newman [Newman] $ cmd /c call C:\Users\amir\AppData\Local\Temp\jenkins131434029649012710.bat

C:\Users\amir.jenkins\workspace\Newman>cd C:\Users\amir\node_modules\newman\bin

C:\Users\amir\node_modules\newman\bin>node newman -c "C:\Users\amir\Documents\Postman Collections\Test.postman_collection.json" newman: the v2.x CLI options are deprecated. You should use newman run [options] instead. refer https://github.com/postmanlabs/newman/blob/develop/MIGRATION.md for details. newman

Test

→ getProjectAlerts copy POST https://openweathermap.org/apii [200 OK, 91.8KB, 1610ms] √ Status code is 200 √ Body matches string

┌─────────────────────────┬──────────┬──────────� │ │ executed │ failed │ ├─────────────────────────┼──────────┼──────────┤ │ iterations │ 1 │ 0 │ ├─────────────────────────┼──────────┼──────────┤ │ requests │ 1 │ 0 │ ├─────────────────────────┼──────────┼──────────┤ │ test-scripts │ 1 │ 0 │ ├─────────────────────────┼──────────┼──────────┤ │ prerequest-scripts │ 0 │ 0 │ ├─────────────────────────┼──────────┼──────────┤ │ assertions │ 2 │ 0 │ ├─────────────────────────┴──────────┴──────────┤ │ total run duration: 1970ms │ ├───────────────────────────────────────────────┤ │ total data received: 91.19KB (approx) │ ├───────────────────────────────────────────────┤ │ average response time: 1610ms │ └───────────────────────────────────────────────┘

C:\Users\amir\node_modules\newman\bin>exit 0 Finished: SUCCESS

Any idea?

1
have you tried the option --disable-unicode in your newman command ? can you show in a clear way your newman command and options, please ?A.Joly
Below is my Jenkins execute windows batch command for that build : cd C:\Users\amir\node_modules\newman\bin node newman -c "C:\\Users\\amir\\Documents\\Postman Collections\\Test.postman_collection.json"Amir

1 Answers

7
votes

I did not use it with Jenkins but, obviously, you're missing some parameters. Have a look here for newman options you could use.

First you should do newman run -c "C:\\Users\\amir\\Documents\\Postman Collections\\Test.postman_collection.json" and if you still have strange characters issue, try the -disable-unicode option