Parameterization using 'CSV Data Set Config'
Parameterization: It's a Technique for generalizing an same action at same time with many users.
Example 1 : Simple Search using different Keywords.
Say : Testing, Development and Design.
Step:1
Input keyword as "Testing" and Search in google (https://www.google.comgle). and record the respective script
For recording please refer : http://bharati-anuchuri.blogspot.in/2015/03/apache-jmeter-introduction-and-tutorial.html
The recorded screen will be as follows.
Step:2
Open a notepad and enter the keywords as Testing, Development and design
Save the page as 'search.csv' in the same place where the recorded script (.jmx) file being kept.
Step:3
From the recorded script, select the 'search' request > from 'send parameters with the request' >
Change the parameter of 'q' - Testing to ${P}
Step:4
After replacing the parameter, add 'CSV Data Set Config' by right clicking on the 'Search' element > Add > Config Element > CSV data set config.
Add, file name as search.csv (which we added on notepad and saved),Variable name as P and select the values as 'True' for Stop thread on EOF, Apart from these don't make any other changes.
Step:5
Click on Thread Group and change Number of Threads as 3 and Ramp-Up Period as 3. I am suggesting to make it 3 because we are going to search 3 key words. Or you can say we are going to user 3 users to search each keywords.
Save the recorded script by pressing ctrl+s. Now we can say that, we are done with scripting part and now if needed add some listeners and check the result or server response.
Am going to add, View result tree to check the result.
Step:6
Right click on the thread group > Add > Listener > View result tree.
Run the script (ctrl+R), response should be as follows.
0 comments:
Post a Comment