My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
ParameterizedController  

Controller
Updated May 3, 2011 by a...@apc.kg

Parameterized Controller since 0.1.0

When your JMeter test plan tree becomes like a sequoia or a banyan, you start feeling yourself like a monkey in a jungle, jumping from branch to branch, trying to support this important test consistent. You really need some way to have parameterized subroutines, to reuse parts of test plan like regular programming language functions and procedures.

JMeter have out-of-box Module controller, but it has no parameters to pass to, so if you need to call repeating sequence of the same action with different parameters, your reflection in a mirror starts morphing into monkey. Parameterized Controller helps you stay human and sane.

Tutorial

Let's create empty test plan and add first Thread Group to it. Rename thread group into "Modules", right-click it and select "Disable", that's the most preferrable way to have modules container inside your test plan. Avoid using Workbench as such container.

Add a Simple Controller to Modules, then add Debug Sampler to Simple Controller. Simple Controller is now our reusable module. Let's rename it to "Reusable Module 1"

Add second Thread Group to test plan. Add two Parameterized Controllers to Thread Group.

Add one Module Controller to each Parameterized Controller. Select "Test Plan > Modules > Reusable Module 1" in both Module Controllers. Now we are re-using a module, but still without parameterization.

Go to first Parameterized Controller and add 2 variables with values, e.g. "var1=val1" and "var2=val2". Go to second Parameterized Controller and add 2 variables with values, e.g. "var1=${var2}" and "var2=val3". We defined 2 parameters, and our module will be called with their different values.

Add View Results Tree listener to test plan to visualize results. Now your test plan should look like this:

Run the test. Go to the View Results Tree and investigate Response data tabs for both samples. You'l see that var1 and var2 had different values inside different Parameterized Controllers.

Download Example Test Plan

Comment by Alexande...@gmail.com, May 18, 2010

Just found - jmeter 2.3.4 lets to define Vars in SimpleModuleCOntroller. Moreover, values of variables defined in the ParametrizedController? was overwriten by Vars in SimpleModuleCOntroller itself.

Comment by project member a...@apc.kg, Jun 5, 2010

What is SimpleModuleCOntroller???

Comment by ajayal...@gmail.com, Nov 25, 2010

Superb..

Comment by pallavi3...@gmail.com, Jan 26, 2011

Hi,

This is really good, How could I get this Parameterized controller plugin, Please help.

Thanks, Pallavi

Comment by project member a...@apc.kg, Jan 27, 2011

Pallavi, just go to Downloads section, get latest release and install it into lib/ext directory of JMeter

Comment by pallavi3...@gmail.com, Jan 27, 2011

Hi,

Thank U very much, I could use the Jmeter Plugins and add the parameterized controller,

I tried to use that in a JmX script having a Login and other set of samplers, I wanted to reuse Login in the same so configured the Parameterized (with the different login credentials as from the ones in User defined variables ) controller which had a Module controller within, pointing to this Login script...

When I ran the test, the Login was executed only once but the response indicated it was picking the values fromUDV, defined Globally and not from the parameterized controller.

But the Debug sampler after the Paraemetrized controller, displayed the credentials as in parameterized controller.

Could you please help me out,to get this right... If I was wrong anywhere...

Thanks & Regards, Pallavi

Comment by project member a...@apc.kg, Jan 27, 2011

The best way is to use different variable names for Controller parameters, so they will not clash with UDV or properties. Try this approach, and say if you succeeded.

Comment by pallavi3...@gmail.com, Jan 27, 2011

Hello, Thank u very much, I could get them up n running, while using them with different variable names!

Thanks again

Comment by klorofi...@gmail.com, Mar 4, 2011

Wow, you would surely deserve a fresh beer :) Not only jmeter is now totally modular but you also provided a way to share variables between a group of thread groups. I love it. Thx

Comment by project member a...@apc.kg, Mar 4, 2011

Thank you! I thought nobody found this plugin useful...

Comment by evanphe...@gmail.com, Jul 7, 2011

Great plug-in. Does it actually share variables between thread groups as suggested by klorofi...@gmail.com?

Comment by project member a...@apc.kg, Jul 7, 2011

Actually I did not get what klorofi.. mean.

Comment by ani...@testingczars.com, Oct 3, 2011

I record a webapplication using proxy server.1st it goes to the login page.and after the login page becomes successful the next page contains details about user like firstname,lastname.

I successfully record this and its running fine.but my question is after i parameterized firstname and lastname the value of this field not updated in the webapplication.

Anyone please guide.Thanks

Comment by project member a...@apc.kg, Oct 3, 2011

You better ask this question on JMeter mailing lists jmeter.512774.n5.nabble.com since it is not somehow connected with this plugin. People at that list answers such questions quickly.

Powered by Google Project Hosting