JMeter Module Controller Example

Module Controller in apache jmeter is one of the important and frequently used logic controller in any software web applications load test plan. Earlier we learnt usage of different jmeter logic controllers with example which are listed on Jmeter Tutorial but module controller is different from all of them. Module controller allows you to redirect test execution to a given fragment of the test or you can say selected module. Let's take simple example to understand usage of module controller better for your software web application's load testing.

Supposing i have load test plan for software web application to perform load test for three different scenarios as described bellow.

Scenario 1 : Create account -> View Basket -> Add Address -> Make payment.
Scenario 2 : Login -> View Basket -> Add Address -> Make payment.
Scenario 3 : Guest user -> View Basket -> Add Address -> Make payment.

Now if i wants to run all three scenarios at the same time in jmeter load test then i can add all requests of specific scenario under simple controller as shown in bellow given image.

Now if you will run above test plan, It will execute requests of all three simple controllers one by one as shown in above image.

Now supposing i wants to perform load testing on only login module scenario(Simple Controller) then i need to use module controller. Module controller will allow me to run only selected simple controller's requests. Let's modify above software application's load test plan to implement it practically.
  1. Add simple controller and put above three simple controllers under it as a child controller.
  2. Disable parent simple controller.
  3. Add module controller parallel to parent simple controller as shown in bellow image.
Inside module controller, You can see all three simple controllers as shown in bellow image and you can select any one from them.

Now as per requirement, I wants to run load test on login scenarios only. So select Simple Controller 2 from Module controller as shown in above image and run load test plan of software web application. It will execute only requests of simple controller 2 as shown in bellow image.

Test Plan To Run Load Test On Single Module

Now supposing you wants to run load test on any 2 modules(Create account and guest user checkout) from 3 then you load test plan will looks like bellow.

Test Plan To Run Load Test On Selected Modules

It will execute requests of Create account and guest user checkout only as shown in bellow image.

This way you can use module controller in your software web application's jmeter load test plan to execute test on selected modules only from multiple modules.

No comments:

Post a Comment