0
votes

I have setup an SMTP sampler in JMeter that gets the body data from a csv file. It reads the first element and then stops. Any suggestions on what could be wrong?

The CSV file looks like this:

"This is 
a multiline 
record
"`"This is
a seond
multi line
record
"`"And this is a third record"

Result

enter image description here

Configuration

enter image description here

1

1 Answers

1
votes

As per CSV Data Set Config documentation

JMeter supports CSV files with quoted data that includes new-lines.

By default, the file is only opened once, and each thread will use a different line from the file.

So the "line" with newline characters needs to start from the new line (hopefully it makes sense), you need to organize your CSV file a little bit differently to wit:

"This is 
a multiline 
record
"`
"This is
a seond
multi line
record
"`
"And this is a third record"

If you don't have possibility to amend your CSV file you will have to go for other options of reading the data, i.e. using JSR223 Test Elements and Groovy scripts or storing the data into the database and using JDBC Test Elements for retrieving it