artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
8.04k stars 511 forks source link

Support getting headers from csv #123

Open jdarling opened 8 years ago

jdarling commented 8 years ago

Generally when I setup a CSV the first row is the column headers. How about an option to use the first row as the fields map? Or an option to ignore the first row in the CSV input file?

jdarling commented 8 years ago

Also it would be great to have some type of comment line. So you can do things like mark users types in blocks.

hassy commented 8 years ago

Good idea on the CSV headers @jdarling.

With comment lines - do you mean comments inside the CSV file? If so, you could add a comment column for that (and not use it in the script)?

jdarling commented 8 years ago

Not sure... So for us we have multiple user account types; instructor, validated-instructor, student, etc... I'd like to keep them separate (for management) yet run them all at the same time. One thought would be to use multiple CSV files, the other would be to have some type of comment line that could be set in the CSV. Maybe something like if the line begins with # it gets ignored.

Actually thinking about it now, it would be nicer to have named CSV sources. That way you could do something like {{ instructors.username }}. Maybe a way to do multiple sources per name.

Really needs more thought, and I'm rambling quite a bit :D.

jdarling commented 8 years ago

Looking at the code I figured out I can put my data into multiple files and make payload an array. This worked well for the global data.

danielo515 commented 8 years ago

Ideally, if the CSV includes headers we can omit the fields declarations and made all the headers available automatically.

dbb613 commented 6 years ago

Further this would be helpful so that Artillery can skip the header row rather than treat it like data, forcing me to manually remove headers or write custom logic to skip it in my custom code.

Limess commented 6 years ago

If this isn't the case, can you add a note on this do this docs page:

https://artillery.io/docs/examples/#using-csv-files

There's no indication that headers are not supported and that they will be included in the first request.

chrc commented 3 years ago

cf.