Parametrization can be implemented in different ways using the following elements:
a)Using CSV Data Set Configuration:
Steps: Thread Group > ADD > Config Elements > CSV data set Config
b.)Using User Parameters:
Steps: Thread Group > Add -> Pre Processors -> User Parameter
We take a example of gmail account using CSV Data Set :
Suppose we recording the gmail login screen with valid credentials.
Username is 'anita' & password is '12345678'.
We Need to parametrize 'username' & 'password' fields. Because 'anita' & '12345678' are recorded values for specific credential.If you want to run the same script with different username & password for Gmail, in that case you has to parametrize:
Following are the Steps :
1.Open the notepad or excel, put desired username & passwords & save it with .CSV extension for example gmaillogin.csv.
Username & password should be seperate using coma. In that way, you can prepare the list of different users & passwords.
2.JMeter-> Thread Plan > ADD > Config Elements > CSV data set Config
3.CSV data set config dialog box will displayed as under this following fields are :
*Filename: if your file is in the /bin directory, this can be just the filename. If its somewhere else, use the full path to the file.
*Variable names: this is the equivalent to a column name in a spreadsheet.
*Delimiter: comma is the default delimiter, but if your file uses tabs this is the place to say so.
4.After the CSV step is filled out correctly, go back to your HTTP request and change the value of the login and password fields to variables.
5.On Parameters tab in Username & Passwords fields 'anita' & '12345678' would display.