Wednesday, February 24, 2016

Jmeter Include Controller Example

| Wednesday, February 24, 2016
Include controller of JMeter is rattling useful if yous wants to intermission your seek innovation inward modest fragments. There are many unlike jmeter controllers available. Each of them cause got unlike exercise equally per it's name. Include controller is useful to include external seek fragment inward your test. Means yous tin include external seek fragment inward your software charge seek innovation using include controller.

Let's cause got elementary example. You cause got five unlike charge seek scenario for your software spider web application in addition to each needs login to software spider web application to perform side yesteryear side steps. That way yous remove to tape login steps inward all five scenario's charge seek plan. So yous are duplicating the mutual procedure steps inward each seek innovation in addition to it volition increase seek innovation maintenance toll too. Include controller tin tending yous inward this situation.

Include controller provides yous facility to exercise external seek fragment inward your seek plan. So yous cause got to salve login steps equally a seek fragment in addition to and then yous tin exercise that seek fragment inward your all software charge seek plans using Include Controller. Let's sympathize amongst practical example.

I cause got iv unlike requests equally bellow.
  1. Login
  2. My Account
  3. My Orders
  4. My Address
This is ane scenario of my software spider web application's charge seek innovation in addition to at that topographic point are to a greater extent than iv such scenarios where Login asking is required. So I volition salve Login asking equally seek fragment equally shown inward bellow given steps in addition to and then i volition exercise that seek fragment inward my unlike tests to login.
  • Put Login asking nether Simple Controller.
  • Right click on Simple Controller
 Include controller of JMeter is rattling useful if yous wants to intermission your seek innovation inward modest Jmeter Include Controller Example
  • Select "Save equally Test Fragment".
 Include controller of JMeter is rattling useful if yous wants to intermission your seek innovation inward modest Jmeter Include Controller Example
  • Give your desired advert to seek fragment in addition to salve it at your desired location. I cause got saved it amongst "Login module.jmx" at E:\JMeter\ path.
Now exercise novel software charge seek innovation and 
  • Add Thread Group nether Test Plan(Right click on Test Plan -> Add -> Threads -> Thread Group).
  • Add Include Controller under Thread Group(Right click on Thread Group -> Add -> Logic Controller -> Include Controller).
 Include controller of JMeter is rattling useful if yous wants to intermission your seek innovation inward modest Jmeter Include Controller Example
  • In Include controller, Select "Login module.jmx" from E:\JMeter\ equally Filename using browse push equally shown inward bellow image.
 Include controller of JMeter is rattling useful if yous wants to intermission your seek innovation inward modest Jmeter Include Controller Example

  • Add elementary controller under Thread Group in addition to add/record My Account, My Orders and My Address requests nether it equally shown inward bellow image. 
  • Also add View Results Tree listener under Thread Group.


You tin download "Login module.jmx" in addition to seek innovation for Include Controller from THIS PAGE.

Now if yous run higher upwardly seek innovation using Number of Threads = 1 in addition to Loop count = 1 inward Thread Group,
  • First it volition execute Test Fragment(Which contains login request) of Include Controller and 
  • Then it volition execute requests(My Account, My Orders and My Address requests) of elementary controller equally shown inward bellow given image.

Same way, You tin exercise "Login module.jmx" inward all other jmeter software charge seek plans where login is required.

This way, Include controller allows yous to intermission your seek innovation to reuse it inward other seek plans in addition to cut duplication of mutual steps. So it volition also cut toll of seek innovation maintenance.

Related Posts