0
votes

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:

  • Step 1: 2 requests for uploading the above file
  • Step 2: POST request with information about the filled fields
  • Step 3: request for uploading the file (without any information about this file in the body and in the parameters)
  • Step 4: request to get a newly created task (response to this request should contain information about the task saved by the script). THE ABOVE MANIPULATIONS WITH JMETER SHOULD RESULT IN CREATING A NEW TASK BUT IN FACT, NOTHING HAPPENS. When doing the above steps MANUALLY, everything works fine — a new task is created and displayed in the browser.

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: enter image description here

I've added data into Files upload section: enter image description here

The file is located in bin folder.

Another request to upload a file is POST request: enter image description here

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.

3

3 Answers

1
votes

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:

enter image description here

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.

1
votes

try to add Files Upload data to the POST request

1
votes

Files upload data can be sent only with a POST request; check cookies and headers