Reputation: 17
I have an API which requires an image along with few other parameters in its request body. In postman, the request parameters can be added in form-data (as shown in the attached image).
How can I implement it in Jmeter?
Upvotes: 0
Views: 760
Reputation: 168237
Like this:
other parameters: userDataJson
, requestReferenceId
, etc. should go to "Parameters" tab.
Also be aware that given you can execute your request successfully in Postman you should be able to record it using JMeter's HTTP(S) Test Script Recorder.
Upvotes: 1
Reputation: 58902
Check Use multipart/form-data, add file in Files Upload tab and parameters in Parameters tab
if you are sending a file using a multipart form, the query string will be created using the multipart form specifications.
If it doesn't work you can use HTTP(S) Test Script Recorder while sending postman request
HTTP(S) Test Script Recorder allows JMeter to intercept and record your actions while you browse your web application with your normal browser. JMeter will create test sample objects and store them directly into your test plan as you go (so you can view samples interactively while you make them). Ensure you read this wiki page to setup correctly JMeter.
To use the recorder, add the HTTP(S) Test Script Recorder element. Right-click on the Test Plan element to get the Add menu: (Add → Non-Test Elements → HTTP(S) Test Script Recorder ).
Upvotes: 0