0
votes

I am trying to find how to encode line feeds or how to format my csv input for jmeter.

I need to pass 1000 form-data like this one:

`--custom_boundary Content-Disposition: form-data; name="textualQuery"

transgenic organisms in Netherlands --custom_boundary Content-Disposition: form-data; name="searchProfile"

generic --custom_boundary Content-Disposition: form-data; name="targetCollections"

http://myorganization.org/publications/ --custom_boundary Content-Disposition: form-data; name="semanticAndMember"

http://myorganization.org/Taxonomy/Topics#T6583 --custom_boundary Content-Disposition: form-data; name="resultStartsAt"

1 --custom_boundary Content-Disposition: form-data; name="resultEndsAt"

10 --custom_boundary Content-Disposition: form-data; name="precision"

4 --custom_boundary Content-Disposition: form-data; name="dateFrom"

2010-01-01 --custom_boundary-- `

I know how to handle csv columns and get the param in JMeter but I have tried to replace line feed by \r\n or \n or \r etc but nothing works...

I would really appreciate if anybody could share his experience.

Fred

2

2 Answers

0
votes

Well, I can imagine 2 use cases and solutions:

  1. If you have a single file which has all these lines and you need to pass them all as a single HTTP Request body you can use __FileToString() function
  2. If you need to use each string from CSV in a separate HTTP Request sampler - go for __StringFromFile() function

See How to Use JMeter Functions articles series for comprehensive information on using the most frequently required JMeter functions.

0
votes

I finally did it another way round by using params in the request and encode it as multipart/form-data. I get my params from an simple csv. It was difficult to find exactly the right settings to generate headers and encoding fitting to Marklogic but it's ok now. Thanks for your help anyway !