0
votes

I have a login form that has form method set to POST, form-action set to a servlet, and an OnSubmit function to check the field data.I want to performance test a file download funcitonality that lies behind this login form. To acheive this i am running a parallel sampler to login and then download the file.

The first sampler is for the login and the second one is to dowload the file.

In the first sampler, I want to POST data on this form using JMeter's HTTP Reqest Sampler. I have inspected the form and created a sampler with three parameters, the username, the password and one more non-discloseable field. I have set the path to the servlet since it is the one handling the requests for the form. The post request doesn't do anything in this case.

What should i do or check or modify to make sure that the POST request is hitting the correct endpoint and that it actually submits the form data.

2

2 Answers

0
votes

You need the samplers to be sequential, I think if you attempt to download the file without prior logging in - the request will fail somewhere somehow.

If it is not sufficient and you would like to add an extra level of checks, i.e. test that the endpoint returns anticipated response code or has certain text you could add Response Assertion as a child of the request and add pass/fail criteria there.

If you don't know how to properly build login and download requests, the easiest way is just recording them using HTTP(S) Test Script Recorder, JMeter will capture the requests and generate relevant HTTP Request samplers and HTTP Header Managers

0
votes

You could add in a View Results Tree Listener to see what response you're getting from the request?