Simple Parameterization in Jmeter:

When you want to run/execute one test plan for more than one user at the same time you go for parameterization. It is a method of generalizing an action.

Here is a simple example to parameterize a Google search for three different users.

1. Record a simple Google search in Jmeter. Put the search keyword as “Jmeter”. The result will be something like this.

recording

We will parameterize the search keyword “Jmeter”.

2. Now add a CSV Data set Config and a Listener element to the thread group.

Add->Config Element->CSV Data Set Config
Add->Listener->View Results Tree

3. Now open a notepad (inside bin) and enter your keywords.

para2

Save the file as search.csv. The extension csv makes it a comma separated Value (CSV) file.

4. Now select the CSV Data set Config element and fill in the fields as follows

Filename: search.csv

(Give the path name if you have put it inside a subfolder e.g. foldername\search.csv)

Variable Names: A

(This variable name is referenced in the search sample.)

Delimiter: ,

para3

5. Now go to search sample and change the value of variable q to ${A}.In Jmeter we reference a variable using ${} .For each iteration the value of q will be replaced as fetched by variable A.

para4

6. Now go to thread group and make the number of threads (users) to 3.

7. Run the script(ctr+R) and observe the result in result tree.

para5


About these ads

12 Responses

  1. HI, I am using jmeter2.3.2 in which i doing parameterization using CSV Data set config element and in my CSV file I have provided 5 user/passwords. I have recorded the login script through badboy then exported it into jmeter.
    My problem is that when I am proving up to 1-9 users it is running them without giving error.
    If I am providing 10 user in main thread group it is generating error in listeners.(If I am providing 9 user then it is taking 5 user that I have provided in CSV file and 4 blank user I don’t know why?)
    Please somebody help.

  2. Hello,
    I am usingparameteization using csv file. somereason it doens’t work. It reads the fist row only. Can someone help me please.

  3. Yes, I understand you. In it something is also thought excellent, agree with you.

    gry zrecznosciowe
    | gry logiczne

  4. Hey guys,
    Can somebody please tell me if I want to simulate multiple APIs using Jmeter and for each API I have to download a .csv file. How can I do it.

    Please help.

  5. hi thanks boy!it worked very good…

  6. Hi, Is Jmeter compatible with Siebel application ? As i am able to record and also parameterize through CSV config file but the parameterised values gives are not getting overridden by the recorded values. So is there any correlation required for it.
    Please let me know.

  7. java.net.ConnectException: Connection refused: connect
    at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.(Unknown Source)
    at java.net.Socket.(Unknown Source)
    at org.apache.jmeter.protocol.http.sampler.AjpSampler.setupConnection(AjpSampler.java:153)
    at org.apache.jmeter.protocol.http.sampler.AjpSampler.sample(AjpSampler.java:111)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:965)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:951)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:348)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:243)
    at java.lang.Thread.run(Unknown Source)

    this error message is displayed.

    • Hi,
      Check the URL of the application which is recorded through Badboy and in Jmeter execution file in first step on Server Name or IP text box.

  8. Im using it to enter username and password two fields but there is a error msg displayed in the result tree.i have two variables for both username and password, as i have taken two different files for both usernames and password

  9. hii..thakzzzz…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: