Runtime controller

It fixes the time limit for its children to be run. If you have specified 20 seconds then the samples will be generated for 20 seconds.

Create a new test Plan. Add a thread group to the test plan. Add a Runtime Controller to the Thread group and under the controller add four HTTP Request Element sampler. Name them as 1,2, 3, 4 and put Server name: www.google.co.in and Path:/

Give the Run time as 25 seconds in the controller. Run the script and observe in View listener tree.

runtime1

In view listener tree select the first sample and under sampler result tab note the sample start time.

runtime2

Similarly get the start time of the last sample. Their difference gives the Run time we have given.

In this example:-

First sample -Sample Start: 2009-02-05 12:05:06 IST
Last sample- Sample Start: 2009-02-05 12:05:31 IST
——————————————————————–
The difference comes=00:00:25

Advertisements

Random Order controller

It executes the samples under it randomly at most once.

Add a Random Order Controller to the thread group.Put 4 samples under it named 1, 2, 3, and 4 . Run and see the order of execution of samples are randomly generated each time.

random-controller

Include Controller

The include controller is designed to use an external jmx file. To use it, add samples to a simple controller, then save the simple controller as a jmx file. The file can then be used in a test plan.

Open a new file.Under workbench add a Simple controller, to that add an Http request element sampler. Fill the values as follows

Name: external
Server name: www.google.co.in
Path:/

Now select the simple controller and save it as (right click-> save selection as) external.jmx.

ic1

Now open a new test file and add an HTTP request under thread group .Name it as A. Add an Include controller to the thread group. And there give the filename as external.jmx with full path (include test plan).ic2

Now run the script and see that both A and External samples have been generated.ic3