newman
newman
1
2
3
4
5
6
7
newman run \
-d postman/vlans-post.json \
--reporters=cli,htmlextra \
--env-var access_token=$TOKEN \
--folder '/vlans-post' \
--reporter-htmlextra-export newman/network.html \
--verbose postman/postman_collection_v5.json
I have a collection in Postman which loads “payload objects” from a json file and want to make it run in newman from command like.
POST request
Body: of POST request I have got ``
Pre-request Script: logically pm.globals.set("jsonBody", JSON.stringify(pm.iterationData.toObject()));
and a file.json file with this kind of “objects”:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[
{
"data": {
"propert1": 24,
"property2": "24__DDL_VXS",
...
},
{
"data": {
"propert1": 28,
"property2": "28__HDL_VDS",
...
}
...
]
Works like a charm in Postman.
Here is what I’m trying to run in cmd.
1
2
3
4
5
newman run \
-d file.json \
--env-var access_token=$TOK4EN \
--folder '/vlanspost' \
postman/postman_collection_v2.json
Based on the results I am getting - it looks like
This post is licensed under CC BY 4.0 by the author.
