Parameterization:
Using
Parameterization we can execute one test plan for more than one user at the
same time. This is a method of generalizing an action for many users.
For Example- If three different people want to search three different
keywords then we need to parameterize. So once Jmeter will execute it will take
the first keyword and search then it will take second keyword and then
finally it will take last keyword and perform the operation.
Please follow
the instruction to parameterize the simple search in google for three different
keywords (Testing, Jmeter, Selenium)
We are going to parameterize for the search of three
keywords – (Jemter, Test, Selenium) in google.
To Parameterize Jmeter please follow
the steps give below-
1) Open notepad and type the words-
2) Save page on desktop as search.csv
3) Follow the process and record the script for
google search for a single word in Jmeter. Why I am suggesting single word
because later we are going to parameterize other words.
Once the script will be recorded the page will
look like-
Once the script will be recorded the page will look like-
4) Now Click on the thread name
search and change “q” parameter as ${A}. ‘A’ we
are going to use as a Variable to store different parameters for the search.
Please refer the screen shot-
After Replacement-
5) Now right click on the thread search and add CSV Data
Set Config.
Right Click on search thread–> Add–> Config Element–> CSV
Data Set Config.
Once CSV Data Set Config page is added we need to
configure-
Filename- This
is the name of the file where you are going to save the different search words.
(Don’t worry I will make you easy to understand in next few steps.)
Variable
Names- This is
the name of the variable where we will store the search data during running the
script.
Stop
thread on EOF- Once
search will be completed the thread will get stopped automatically.
So now I am going to configure these
fields-
Filename-
search.csv
Variable
Names- A
Stop
thread on EOF- True
6) 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.
Here we are done with all the configurations.
You can add some listeners to view
the result by right clicking on thread group. I am going to add listener as
Summary Report.
Now just press Ctrl+s to
save the jmeter script and run the script by pressing Ctrl+r and see the magic.
J
J J
No comments:
Post a Comment