Bittu Choudhary
Bittu Choudhary

Reputation: 65

How to send audio file with http request sampler Jmeter?

I am searching for an option so that I can send audio file with http request sampler without pasting content from audio file(makes script heavy).

Upvotes: 0

Views: 901

Answers (2)

Bittu Choudhary
Bittu Choudhary

Reputation: 65

__FileToString()

We can do so by using __FileToString(File_path,Encoding_type) method.

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168157

If you switch to "File Upload" tab of the HTTP Request sampler you will be able to provide path to the file for uploading along with its MIME type and associated parameter name.

JMeter File Upload

This way your test plan will contain only path to the file, not its content so the size of .jmx script will not be increased.

The easiest approach to build the file upload request is just recording it using JMeter's HTTP(S) Test Script Recorder, just make sure you copy the file(s) to "bin" folder of your JMeter installation so JMeter could capture the request and build the relevant HTTP Request sampler configuration. See Recording File Uploads with JMeter article for more details.

Upvotes: 1

Related Questions