Reputation: 111
SCENARIO: AN AUTHORIZED PM CREATES A TASK ON PORTAL XXXX. HE/SHE FILLS OUT A FORM AND UPLOADS A FILE (ZIP) TO THE PORTAL.
Steps to do with JMeter to realize the above scenario:
NOTE: The responses to the above JMeter generated requests do not contain any error information. Responses to the file upload requests sent manually and by JMeter are the same. The POST requests sent manually and by JMeter differ only by ID variables. The only difference is in the Step 3 request (which does not contain any information about the uploaded file or variable parameters) for uploading the file. The final request does not contain information about the new task which we tried to create with JMeter. Requests have been parametrized, the missing cookie was added. Could you please tell me the reason for such behavior? Thank You for your help in advance 😊
File upload request was recorded as GET:
I've added data into Files upload section:
The file is located in bin folder.
Another request to upload a file is POST request:
Developers say that the request contain just the file data and its body should be the same for all users, date/time etc. But I'm not sure about its encoding.
Upvotes: 0
Views: 336
Reputation: 100
Files upload data can be sent only with a POST request; check cookies and headers
Upvotes: 1
Reputation: 168237
If you're seeing differences between the responses for the requests originated from JMeter and the real browser the only reason is that requests are not the same so I would recommend using View Results Tree listener and your browser developer tools (or external sniffer tool like Wireshark or Fiddler) and compare the requests and responses.
Given you send the same request (apart from any dynamic data which needs to be correlated) you should receive the same response, no matter of origin: browser, JMeter, programs like curl
Pay attention to your "Step 3" because for uploading the file you need to provide this file location under "File Upload" tab of the HTTP Request:
If you're building your test plan using HTTP(S) Test Script Recorder make sure to have the file you're uploading in "bin" folder of your JMeter installation during recording and during replay, only this way JMeter will be able to properly capture the request.
Upvotes: 1