Using "Interleave Controller" In Apache Jmeter windows Example

Before using interleave controller in performance testing tool Apache Jmeter, You must be aware about how to Record and Run first test plan in jmeter load testing tool in windows OS. There are many controllers available in apache jmeter performance testing tool and one of them is Interleave controller. Interleave
controller in apache jmeter is basically useful for providing some more load on specific page compared to other pages of software web application. Now let me describe here one scenario for better understanding.

Supposing i have a software web application with 4 pages. 1. Home, 2. News, 3. FAQ and 4. About Us Page and obviously home page has to face more load as compared to other pages in real world scenario. So let we consider this scenario in our example. My recorded jmeter example test case is as bellow.

Adding interleave controller in jmeter performance testing tool
To add Interleave controller in right click on your thread group (Testing Thread in this case)

  • Go to Add -> Logic Controller -> Select 'Interleave Controller'. Now Interleave Controller is there in your jmeter test plan. 
  • Cut "News Page" HTTP request from thread group by right clicking on "News Page" and paste under "Interleave Controller" by right clicking on "Interleave Controller" as shown bellow

Add View Results Tree listener and set thread group parameters for jmeter load testing
  • Right click on Thread group and Go to Add -> Listeners -> Select 'View Results Tree'. Now listener is there in your test plan
  • Set Number of Threads(users) = 1 and Loop Count = 5 in Thread group. You can read more about thread group parameters in my this post.
  • Now your Apache Jmeter test plan will looks like bellow.

Run above test and look at View Results Tree results during test running. results will be as bellow.

Look at above results of View Results Tree listener.
  • First of all, Home Page request is executed.
  • 2nd is executed News Page request.
  • Once more Home Page request is executed.
  • 4th request executed is FAQ Page.
  • Once more, 5th executed request is Home Page.
This way, request which is located outside of Interleave controller will be executed alternatively to each of request inside Interleave controller. You can try above test case with 2 users for better your practice.

1 comment: