Jordi
Jordi

Reputation: 23187

jMeter: load file content on http request body

I'm trying to inject file content into the request body:

enter image description here

I'm using:

${__FileToString(${__eval(${bundle})},,)}

I've configured the bundle variable using the directory listing plugin:

enter image description here

When I perform the test, I'm getting:

enter image description here

Logs is getting me:

2021-12-28 16:33:53,853 WARN o.a.j.f.FileToString: Could not read open: /patient-bundle-0193.json

According to my configuration, __FileToString should read from /home/jeusdi/projects/workarea/salut/mpi/jsons/bundles/extractions/10000/bundles instead from /...

Any ideas?

Upvotes: 2

Views: 1488

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

Tick Use full path so your bundle JMeter Variable would contain the absolute location of the file.

enter image description here

Be informed that JMeter Variables along with their respective values can be visualized using Debug Sampler and View Results Tree listener combination.

You might also be interested in Introducing the Directory Listing Config Plugin on JMeter article

Upvotes: 1

Related Questions