If you got to test a web application, the first action performed will be login operation. Jmeter which is a performance testing tool, helps to perform multiple login with different user names and password using CSV Data Config. There can be a situation when different users having different rights (say admin/normal user) has to login in the application. Therefore, the load on the landing page will differ as per the rights.
Perhaps, there can also be a possibility when user has to login with same user multiple number of times. Jmeter is helpful in that too.
Lets explore the what exactly is Jmeter and what is the difference and use of CSV and Login Data Config :-
Jmeter: Jmeter is basically an open source software which is completely Java based and designed to measure performance and load test functional behavior.
The Config elements in Jmeter such as CSV Config and Login Config are used as follows:
CSV Data Config Element:
Suppose a user wants to test a website with 20 users signing in application at the same time or you want to fill up the registration form for multiple users in the website.
Manually performing the task will be time consuming and requires lot of efforts,therefore parametrization the script to enter different details say for login or form can be maintained in the text file in the proper sequence, comma(,) separated that further has to be stored in bin folder in Jmeter.
Three values need to be filled on CSV Config screen:
- File name: If file is in the /bin directory, user just needs to enter file name. If it’s somewhere else, paste the complete file path.
- Variable names: This is the equivalent to a “column name” in a spreadsheet.
- Delimiter: Comma is the default delimiter, but if user’s file uses tabs this is the place to say so.
How to write data in text file is as follows:
How to run CSV config with HTTP request:
Steps for the same are as follows:
- Open Jmeter.
- Add CSV data con fig, HTTP Request, any listener for results under Thread Group.
- Run the script.
- The data for multiple login i.e user name and password will be exported from File name (refer screen shot 3) .The File name will be provided in the CSV data config (refer screen shot 2).
Login Config Element:
The Login Config Element is used at the time of login. It adds or overrides the existing user name and password details and don’t let the simultaneous login’s at the same time.
How to open Login Config screen is as follows:
- Name: Descriptive name of the element that has to be shown in the tree.
- User name: Any user name to be used.
- Password: Password for the user name provided.
|CSV Data Config||Login Config Element|
|It is used when multiple user login is required||It is used when single user login is required.|
|Data is stored in .txt file and path is provided in the CSV config screen in Jmeter||Data has to be entered in Login Config Screen in Jmeter|
|Multiple parameters like user name, password, cookie length etc can be stored comma separated in the .txt file .||Only 2 parameters are used in Login config i.e user name and password.|