|
ParameterizedController
Parameterized Controller since 0.1.0When 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. TutorialLet'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. | |

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.
What is SimpleModuleCOntroller???
Superb..
Hi,
This is really good, How could I get this Parameterized controller plugin, Please help.
Thanks, Pallavi
Pallavi, just go to Downloads section, get latest release and install it into lib/ext directory of JMeter
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
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.
Hello, Thank u very much, I could get them up n running, while using them with different variable names!
Thanks again
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
Thank you! I thought nobody found this plugin useful...
Great plug-in. Does it actually share variables between thread groups as suggested by klorofi...@gmail.com?
Actually I did not get what klorofi.. mean.
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.
Anyone please guide.Thanks
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.