2

I want to set header for each request.

header is - "token:value"

For every request this header value will be different and I have a csv file having all tokens listed there. Now, like we use csv for POST data values, I want to use this csv file to set header for each request.

CSV file - "token1,token2,token3"

How to do this in jmeter ?

3 Answers 3

9

To achieve your goal, you should do following for each request:

  1. Add HTTP Header Manager:

enter image description here

2 . Add CSV Data Set Config configured like this:

CSV Data Set Config

Sign up to request clarification or add additional context in comments.

Comments

1

the idea is pretty good, if the referer field is widely used.

I'm not sure that you can use CSV data sets, because it reads ONE line for each user/ thread.

In a situation similar to yours, I had to use a __CSVread function, that allows to manually control if and when to read the next line.

Refer to: "CSVRead">http://jmeter.apache.org/usermanual/functions.html#_CSVRead"

Comments

0

If request the same but header changes, then you obviously need CSV Data Set Config element. Example of usage you can find in %JMETER_HOME%/bin/examples. If requests are different then I'm not sure it makes sens to use CSV file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.