Looping in Jmeter
Why we go for looping ?
Ø
To avoid the length of scripts
Ø
To make our scripts re-usable if our flow having repeated actions .
Steps to create loop:
1.Create a counter by using beanShell
sampler (Do not use inbuilt counter)
Add line vars.put(“counter name”,”value”)
inside beanShell sampler
2.Create loop counter and add all transection
inside loop counter which you want to do for multiple times
3.Add BeanShell postprocessor at http sampler which we are going to loop
> Call counter inside beanShell PostProcessor.This counter we are
going to use for dynamic variable creation
> Create dynamic variable using counter and store values inside it
Ex:
vars.put(“dynamicVariable”+counter,itemValueToStore)
>Increment the counter at the end of loop
refer above image
4. Create httpSampler by using
beanShellPreProcessor to save loop
Ex: If our transaction is to save 100 loop
item then at the time of save we need to create our httpsample to replace
recorded save transaction httpsampler
>Inside beanShellPreProcessor call created dynamic variable and save it in another variable
Ex: newVariable =
vars.get(“dynamicVariable”+j); here j value in loop(refer above image)
>To create name and its value inside
httpsampler use below command
Ex: sampler.addArgument(“Name”,”Value”);
Thanks For Reading My Post
Feel Free To Comment Your Queries
i preview this blog. Most of the points are very interesting to read. its help me to study also. Thanks for your help.
ReplyDeleteJMeter Training in Chennai
learn JMeter
JMeter Course
JMeter Training in OMR
Appium Training in Chennai
javascript training in chennai
core java training in chennai
C C++ Training in Chennai
I found your blog it is very informative and it is interesting . keep sharing more..
ReplyDeleteAngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery