How to login into the web application using JMeter and what are the parameters we need to give for login, logout and login button?
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.
Source 5.6 Logging in to a web-site
The usual scenario looks as follows:
- Record login/logout flow using JMeter's HTTP(S) Test Script Recorder
- Parametrize scenario for multi-user testing to provide different credentials for each virtual user with i.e. CSV Data Set config
- Add HTTP Cookie Manager to enable cookies support
- Detect all dynamic parameters which are hard-coded during recording and substitute them with variables. See ASP.NET Login Testing with JMeter guide for example on how to implement it.