Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While executing collection in node , not able to send my data file #1926

Closed
ghost opened this issue Mar 2, 2019 · 5 comments
Closed

While executing collection in node , not able to send my data file #1926

ghost opened this issue Mar 2, 2019 · 5 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 2, 2019

While executing collection in node , not able to send my data file
Version and environment information:

  1. Newman Version : 4.4.0
  2. OS details (type, version, and architecture): Windows 10
  3. Are you using Newman as a library, or via the CLI - Command line options
  4. Did you encounter this recently, or has this bug always been there: Recently
  5. Expected behaviour: Should be able to run collection fetching the data file sent in js file
  6. Command / script used to run Newman: node Sample.js
  7. Screenshots (if applicable):
    image

Refered below
1.https://github.com/postmanlabs/newman#command-line-options
image

2.https://learning.getpostman.com/docs/postman/collection_runs/command_line_integration_with_newman/
image

  1. How to send data for a collection file in node ?
  2. As per above screenshots , at one file its mentioned as data and in other its mentioned iteration-data
  3. Tried using both options in js file ,none of them is working (while running in cmd prompt using -d its working )

Please help addressing what should be the option for data file .

JS File 👍

const newman = require('newman')
const nodemailer = require('nodemailer')
const MailComposer = require("nodemailer/lib/mail-composer");
const from_who = 'subhashiniarumugham@gmail';
var pdfcrowd = require("pdfcrowd");
newman.run({
collection: 'Downloads/Smoke_Suite.postman_collection.json',
environment: 'Downloads/Aircanada_Int.postman_environment.json',
iteration-data: 'Downloads/Data.csv', (Also tried using data:'Downloads/Data.csv )
iteration-count: '1',
d: 'Downloads/Data.csv',
reporters: 'htmlextra',
reporter: {
htmlextra: {
template: 'Downloads/EIP_INT.hbs',
export:'Desktop/SmokeReport.html',

@DannyDainton
Copy link
Collaborator

DannyDainton commented Mar 2, 2019

Hey,

It looks like you're mixing up the commands for the CLI use and the library use of Newman. You will need to use IterationData within the script. You should also be using IterationCount with that value being a number and not a string.

More information about the different commands available for the script can be found here:

https://github.com/postmanlabs/newman/blob/develop/README.md#newmanrunoptions-object--callback-function--run-eventemitter

@ghost
Copy link
Author

ghost commented Mar 2, 2019

I have tried using IterationData in node script along with iterationCount in number value ,but still its not reading my csv file.

@DannyDainton
Copy link
Collaborator

Would you be able to elaborate more on not reading your file.

Those 2 changes would have solved the error that you were seeing.

Is this now a question around the way the data from the file is used in your collection? Can you provide an example of the file and the way you have the data references in the requests.

@ghost
Copy link
Author

ghost commented Mar 3, 2019 via email

@ghost
Copy link
Author

ghost commented Mar 3, 2019

Able to read and reference the data file after node reinstallation !

@ghost ghost closed this as completed Mar 3, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants