0
votes

When i try to uppload file using Jmeter

I use 'File Upload section' like:

Filepath as:${filesUpploadPath}BatchReverse.csv

ParameterName as: file

MIME type: text/plain

enter image description here

enter image description here

enter image description here

Request

POST data: --TQVDXTBd3I5-r4QtHZ2WSa5B2rsQKtLv Content-Disposition: form-data; name="file"; filename="BatchReverse.csv" Content-Type: text/plain Content-Transfer-Encoding: binary

--AzTQVDXTBd3I5-r4QtHZ2WSa5B2rsQKtLv--

Response {"errors":[{"type":"FATAL","errorCode":"VALIDATION","message":"Missing required parameter fileType."}]}

Any suggestion?

2
Isn't error from your application Missing required parameter fileType?user7294900
Correct. i am sending empty. any idea how should be populated 'Parameters' section?vlatko606
I think your MIME type should be "text/csv"ararar
Still the same. "errors":[{"type":"FATAL","errorCode":"VALIDATION","message":"Missing required parameter fileType."}]}vlatko606
I suggest you check the parameters of this API using your web browser or a web debugging proxy like fiddler, and then add the required parameters on your http sampler.ararar

2 Answers

1
votes

Most probably your "Parameter Name" is wrong, you're using file and your application seems to be expecting fileType

The easiest way of building a proper file upload request is just recording it using JMeter's HTTP(S) Test Script Recorder

The only thing you need to do is to copy the file you're uploading to "bin" folder of your JMeter installation, this way JMeter will be able to properly construct the relevant HTTP Request sampler.

Once you get the "good" configuration and validate it using View Results Tree listener you can parameterize and correlate the request as needed.

0
votes

Tried with Jmeter recorder, and i supposed to used: -MIME type as: application/vnd.ms-excel -Parameters : fileType: REVERSALS