How to login into the web application using JMeter

jmeter

How to login into the web application using JMeter and what are the parameters we need to give for login, logout and login button?

Best Answer

  • How do I login into a web application using JMeter?

    This is documented in the User Manual.

    The instructions below are for login, logout will be similar.


    Logging in to a web-site

    It's not the case here, but some web-sites require you to login before permitting you to perform certain actions. In a web-browser, the login will be shown as a form for the user name and password, and a button to submit the form. The button generates a POST request, passing the values of the form items as parameters.

    To do this in JMeter, add an HTTP Request, and set the method to POST. You'll need to know the names of the fields used by the form, and the target page. These can be found out by inspecting the code of the login page. [If this is difficult to do, you can use the JMeter Proxy Recorder to record the login sequence.] Set the path to the target of the submit button. Click the Add button twice and enter the username and password details. Sometimes the login form contains additional hidden fields. These will need to be added as well.

    enter image description here

    Source 5.6 Logging in to a web-site

  • Related Question