Log postman runner data(cvs) parameters
I want to log the parameters sent through a cvs file when running the Collection runner. Is this possible? I want retrieve a list of all parameters that failed (over 6000 items being tested).
When i export the test result, i can not see the parameters items that failed. Which I want.
Ive tried to log the response as following:
console.log(DRAWING_NO)
DRAWING_NO is a global variable set in the environment
test code
enter var jsonData = JSON.parse(responseBody);
if (jsonData.Drawings === null)
pm.test("sample-test-fail", function ()
throw new Error();
);
let drawingno = pm.iterationData.get("DRAWING_NO");
console.log(drawingno);
else if (jsonData.Drawings !== null)
//postman.setEnvironmentVariable("UFID", jsonData.Drawings.Drawing.UFID);
//console.log(jsonData.Drawings.Drawing.length);
pm.test("Status code is 200", function ()
pm.response.to.have.status(200);
);
jsonData.Drawings.Drawing.forEach(function (data)
postman.setEnvironmentVariable("UFID", data.UFID);
postman.setEnvironmentVariable("INST_TYPE", data.INST_TYPE);
postman.setEnvironmentVariable("HYD_TYPE", data.HYD_TYPE);
pm.test("Check Drawing NO for " + data.DRAWING_NO, function()
pm.expect(data.DRAWING_NO).not.eql(null);
);
pm.test("Check Sales ID for " + data.DRAWING_NO, function()
pm.expect(data.SALES_ID).not.eql(null);
);
pm.test("Check HYD_TYPE for " + data.DRAWING_NO, function()
pm.expect(data.HYD_TYPE).not.eql(null);
);
pm.test("Check INST_TYPE NO for " + data.DRAWING_NO, function()
pm.expect(data.INST_TYPE).not.eql(null);
);
pm.test("Check Sales Code for " + data.DRAWING_NO, function()
pm.expect(data.SALES_CODE).not.eql(null);
);
pm.test("Check LIFECYCLE_STATE for " + data.DRAWING_NO, function()
pm.expect(data.LIFECYCLE_STATE).eql("RELEASED");
);
//pm.test("Check VERSION CODE Code for " + data.DRAWING_NO, function ()
// pm.expect(data.VERSION_CODE).not.eql(null);
//);
//pm.test("Check DRIVE UNIT for " + data.DRAWING_NO, function ()
// pm.expect(data.DRIVE_UNIT).not.eql(null);
//);
//pm.test("Check Outlet US for " + data.DRAWING_NO, function ()
// pm.expect(data.OUTLET_US).not.eql(null);
//);
);
here
javascript list logging postman postman-collection-runner
add a comment |
I want to log the parameters sent through a cvs file when running the Collection runner. Is this possible? I want retrieve a list of all parameters that failed (over 6000 items being tested).
When i export the test result, i can not see the parameters items that failed. Which I want.
Ive tried to log the response as following:
console.log(DRAWING_NO)
DRAWING_NO is a global variable set in the environment
test code
enter var jsonData = JSON.parse(responseBody);
if (jsonData.Drawings === null)
pm.test("sample-test-fail", function ()
throw new Error();
);
let drawingno = pm.iterationData.get("DRAWING_NO");
console.log(drawingno);
else if (jsonData.Drawings !== null)
//postman.setEnvironmentVariable("UFID", jsonData.Drawings.Drawing.UFID);
//console.log(jsonData.Drawings.Drawing.length);
pm.test("Status code is 200", function ()
pm.response.to.have.status(200);
);
jsonData.Drawings.Drawing.forEach(function (data)
postman.setEnvironmentVariable("UFID", data.UFID);
postman.setEnvironmentVariable("INST_TYPE", data.INST_TYPE);
postman.setEnvironmentVariable("HYD_TYPE", data.HYD_TYPE);
pm.test("Check Drawing NO for " + data.DRAWING_NO, function()
pm.expect(data.DRAWING_NO).not.eql(null);
);
pm.test("Check Sales ID for " + data.DRAWING_NO, function()
pm.expect(data.SALES_ID).not.eql(null);
);
pm.test("Check HYD_TYPE for " + data.DRAWING_NO, function()
pm.expect(data.HYD_TYPE).not.eql(null);
);
pm.test("Check INST_TYPE NO for " + data.DRAWING_NO, function()
pm.expect(data.INST_TYPE).not.eql(null);
);
pm.test("Check Sales Code for " + data.DRAWING_NO, function()
pm.expect(data.SALES_CODE).not.eql(null);
);
pm.test("Check LIFECYCLE_STATE for " + data.DRAWING_NO, function()
pm.expect(data.LIFECYCLE_STATE).eql("RELEASED");
);
//pm.test("Check VERSION CODE Code for " + data.DRAWING_NO, function ()
// pm.expect(data.VERSION_CODE).not.eql(null);
//);
//pm.test("Check DRIVE UNIT for " + data.DRAWING_NO, function ()
// pm.expect(data.DRIVE_UNIT).not.eql(null);
//);
//pm.test("Check Outlet US for " + data.DRAWING_NO, function ()
// pm.expect(data.OUTLET_US).not.eql(null);
//);
);
here
javascript list logging postman postman-collection-runner
Have you tried console.log(data.DRAWING_NO)? What's the conditions of a Failure? Do you have a test in place for this?
– Danny Dainton
Nov 12 at 16:21
Yes i have tests in place. So if the DRAWING_NO does not exist, output error. Then some other conditions associated with the response to each DRAWING_NO. If any conditions fail, i want to log the DRAWING_NO as a list. Basically the Drawing_NO is the primary key and the one im doing the search on, on the API request.
– Lucas Dag
Nov 14 at 8:34
Can you update the question with the test code? It might give people an idea of how best to log the failed values out for you. This is just a bunch of words at the moment so it's tough to know what's going on.
– Danny Dainton
Nov 14 at 8:58
Now ive added the test code
– Lucas Dag
Nov 14 at 12:20
add a comment |
I want to log the parameters sent through a cvs file when running the Collection runner. Is this possible? I want retrieve a list of all parameters that failed (over 6000 items being tested).
When i export the test result, i can not see the parameters items that failed. Which I want.
Ive tried to log the response as following:
console.log(DRAWING_NO)
DRAWING_NO is a global variable set in the environment
test code
enter var jsonData = JSON.parse(responseBody);
if (jsonData.Drawings === null)
pm.test("sample-test-fail", function ()
throw new Error();
);
let drawingno = pm.iterationData.get("DRAWING_NO");
console.log(drawingno);
else if (jsonData.Drawings !== null)
//postman.setEnvironmentVariable("UFID", jsonData.Drawings.Drawing.UFID);
//console.log(jsonData.Drawings.Drawing.length);
pm.test("Status code is 200", function ()
pm.response.to.have.status(200);
);
jsonData.Drawings.Drawing.forEach(function (data)
postman.setEnvironmentVariable("UFID", data.UFID);
postman.setEnvironmentVariable("INST_TYPE", data.INST_TYPE);
postman.setEnvironmentVariable("HYD_TYPE", data.HYD_TYPE);
pm.test("Check Drawing NO for " + data.DRAWING_NO, function()
pm.expect(data.DRAWING_NO).not.eql(null);
);
pm.test("Check Sales ID for " + data.DRAWING_NO, function()
pm.expect(data.SALES_ID).not.eql(null);
);
pm.test("Check HYD_TYPE for " + data.DRAWING_NO, function()
pm.expect(data.HYD_TYPE).not.eql(null);
);
pm.test("Check INST_TYPE NO for " + data.DRAWING_NO, function()
pm.expect(data.INST_TYPE).not.eql(null);
);
pm.test("Check Sales Code for " + data.DRAWING_NO, function()
pm.expect(data.SALES_CODE).not.eql(null);
);
pm.test("Check LIFECYCLE_STATE for " + data.DRAWING_NO, function()
pm.expect(data.LIFECYCLE_STATE).eql("RELEASED");
);
//pm.test("Check VERSION CODE Code for " + data.DRAWING_NO, function ()
// pm.expect(data.VERSION_CODE).not.eql(null);
//);
//pm.test("Check DRIVE UNIT for " + data.DRAWING_NO, function ()
// pm.expect(data.DRIVE_UNIT).not.eql(null);
//);
//pm.test("Check Outlet US for " + data.DRAWING_NO, function ()
// pm.expect(data.OUTLET_US).not.eql(null);
//);
);
here
javascript list logging postman postman-collection-runner
I want to log the parameters sent through a cvs file when running the Collection runner. Is this possible? I want retrieve a list of all parameters that failed (over 6000 items being tested).
When i export the test result, i can not see the parameters items that failed. Which I want.
Ive tried to log the response as following:
console.log(DRAWING_NO)
DRAWING_NO is a global variable set in the environment
test code
enter var jsonData = JSON.parse(responseBody);
if (jsonData.Drawings === null)
pm.test("sample-test-fail", function ()
throw new Error();
);
let drawingno = pm.iterationData.get("DRAWING_NO");
console.log(drawingno);
else if (jsonData.Drawings !== null)
//postman.setEnvironmentVariable("UFID", jsonData.Drawings.Drawing.UFID);
//console.log(jsonData.Drawings.Drawing.length);
pm.test("Status code is 200", function ()
pm.response.to.have.status(200);
);
jsonData.Drawings.Drawing.forEach(function (data)
postman.setEnvironmentVariable("UFID", data.UFID);
postman.setEnvironmentVariable("INST_TYPE", data.INST_TYPE);
postman.setEnvironmentVariable("HYD_TYPE", data.HYD_TYPE);
pm.test("Check Drawing NO for " + data.DRAWING_NO, function()
pm.expect(data.DRAWING_NO).not.eql(null);
);
pm.test("Check Sales ID for " + data.DRAWING_NO, function()
pm.expect(data.SALES_ID).not.eql(null);
);
pm.test("Check HYD_TYPE for " + data.DRAWING_NO, function()
pm.expect(data.HYD_TYPE).not.eql(null);
);
pm.test("Check INST_TYPE NO for " + data.DRAWING_NO, function()
pm.expect(data.INST_TYPE).not.eql(null);
);
pm.test("Check Sales Code for " + data.DRAWING_NO, function()
pm.expect(data.SALES_CODE).not.eql(null);
);
pm.test("Check LIFECYCLE_STATE for " + data.DRAWING_NO, function()
pm.expect(data.LIFECYCLE_STATE).eql("RELEASED");
);
//pm.test("Check VERSION CODE Code for " + data.DRAWING_NO, function ()
// pm.expect(data.VERSION_CODE).not.eql(null);
//);
//pm.test("Check DRIVE UNIT for " + data.DRAWING_NO, function ()
// pm.expect(data.DRIVE_UNIT).not.eql(null);
//);
//pm.test("Check Outlet US for " + data.DRAWING_NO, function ()
// pm.expect(data.OUTLET_US).not.eql(null);
//);
);
here
javascript list logging postman postman-collection-runner
javascript list logging postman postman-collection-runner
edited Nov 14 at 12:19
asked Nov 12 at 12:54
Lucas Dag
62
62
Have you tried console.log(data.DRAWING_NO)? What's the conditions of a Failure? Do you have a test in place for this?
– Danny Dainton
Nov 12 at 16:21
Yes i have tests in place. So if the DRAWING_NO does not exist, output error. Then some other conditions associated with the response to each DRAWING_NO. If any conditions fail, i want to log the DRAWING_NO as a list. Basically the Drawing_NO is the primary key and the one im doing the search on, on the API request.
– Lucas Dag
Nov 14 at 8:34
Can you update the question with the test code? It might give people an idea of how best to log the failed values out for you. This is just a bunch of words at the moment so it's tough to know what's going on.
– Danny Dainton
Nov 14 at 8:58
Now ive added the test code
– Lucas Dag
Nov 14 at 12:20
add a comment |
Have you tried console.log(data.DRAWING_NO)? What's the conditions of a Failure? Do you have a test in place for this?
– Danny Dainton
Nov 12 at 16:21
Yes i have tests in place. So if the DRAWING_NO does not exist, output error. Then some other conditions associated with the response to each DRAWING_NO. If any conditions fail, i want to log the DRAWING_NO as a list. Basically the Drawing_NO is the primary key and the one im doing the search on, on the API request.
– Lucas Dag
Nov 14 at 8:34
Can you update the question with the test code? It might give people an idea of how best to log the failed values out for you. This is just a bunch of words at the moment so it's tough to know what's going on.
– Danny Dainton
Nov 14 at 8:58
Now ive added the test code
– Lucas Dag
Nov 14 at 12:20
Have you tried console.log(data.DRAWING_NO)? What's the conditions of a Failure? Do you have a test in place for this?
– Danny Dainton
Nov 12 at 16:21
Have you tried console.log(data.DRAWING_NO)? What's the conditions of a Failure? Do you have a test in place for this?
– Danny Dainton
Nov 12 at 16:21
Yes i have tests in place. So if the DRAWING_NO does not exist, output error. Then some other conditions associated with the response to each DRAWING_NO. If any conditions fail, i want to log the DRAWING_NO as a list. Basically the Drawing_NO is the primary key and the one im doing the search on, on the API request.
– Lucas Dag
Nov 14 at 8:34
Yes i have tests in place. So if the DRAWING_NO does not exist, output error. Then some other conditions associated with the response to each DRAWING_NO. If any conditions fail, i want to log the DRAWING_NO as a list. Basically the Drawing_NO is the primary key and the one im doing the search on, on the API request.
– Lucas Dag
Nov 14 at 8:34
Can you update the question with the test code? It might give people an idea of how best to log the failed values out for you. This is just a bunch of words at the moment so it's tough to know what's going on.
– Danny Dainton
Nov 14 at 8:58
Can you update the question with the test code? It might give people an idea of how best to log the failed values out for you. This is just a bunch of words at the moment so it's tough to know what's going on.
– Danny Dainton
Nov 14 at 8:58
Now ive added the test code
– Lucas Dag
Nov 14 at 12:20
Now ive added the test code
– Lucas Dag
Nov 14 at 12:20
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53262614%2flog-postman-runner-datacvs-parameters%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53262614%2flog-postman-runner-datacvs-parameters%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you tried console.log(data.DRAWING_NO)? What's the conditions of a Failure? Do you have a test in place for this?
– Danny Dainton
Nov 12 at 16:21
Yes i have tests in place. So if the DRAWING_NO does not exist, output error. Then some other conditions associated with the response to each DRAWING_NO. If any conditions fail, i want to log the DRAWING_NO as a list. Basically the Drawing_NO is the primary key and the one im doing the search on, on the API request.
– Lucas Dag
Nov 14 at 8:34
Can you update the question with the test code? It might give people an idea of how best to log the failed values out for you. This is just a bunch of words at the moment so it's tough to know what's going on.
– Danny Dainton
Nov 14 at 8:58
Now ive added the test code
– Lucas Dag
Nov 14 at 12:20