JMeter Intermediate Tutorial 7 - How to use Module Controller and Include Controller

Поділитися
Вставка
  • Опубліковано 6 жов 2024
  • All Free Courses - automationstep...
    JMeter Intermediate Tutorial 7 - How to use Module Controller and Include Controller
    Today we will learn
    -----------
    How to create Modular and Reusable Scripts in JMeter
    1. How to create modular scripts - Module Controller
    2. How to create reusable scripts - Include Controller
    -------------------------
    example:
    Online Shopping Application
    =====================
    Login
    Orders
    Products
    Inventory
    Customers
    Promotions
    ___________________________________________
    JMeter Beginner Playlist :
    • JMeter Beginner
    JMeter Intermediate Playlist :
    • Jmeter Intermediate
    JMeter Advanced Playlist:
    • JMeter Advanced
    ______ ONLINE COURSES TO LEARN _______
    Visit - automationstep...
    Ask Raghav- bit.ly/2CoJGWf
    Interviews - bit.ly/2NIPPxk
    All Playlists - bit.ly/2LSiezA
    ----------- FOLLOW -----------
    Facebook - / automationstepbystep
    Twitter - / automationsbs
    UA-cam - / automationstepbystep

КОМЕНТАРІ • 83

  • @rashmiambedkar5143
    @rashmiambedkar5143 7 років тому +1

    The way you put all thoughts in sequential and with detail explanation with example. Really appreciated and commendable . .. you got a really good voice as a listener its quite pleasing. Thanks a Alot .

    • @RaghavPal
      @RaghavPal  7 років тому

      Thanks a lot for the kind words Rashmi, i am glad these videos helped you.

  • @Zaheer-Abbas
    @Zaheer-Abbas 6 років тому +1

    Thanks Raghav. It was really helpful for me in maintaining the code changes in Performance scripts easily.

    • @RaghavPal
      @RaghavPal  6 років тому

      Great to know this Zaheer

  • @ravibabuit1
    @ravibabuit1 7 років тому +1

    Excellent tutorial. Thanks for sharing it.

    • @RaghavPal
      @RaghavPal  7 років тому

      thanks for watching and learning.

  • @ccJoeMurphy
    @ccJoeMurphy 7 років тому +1

    Great work, clear, and to the point thank u :)

    • @RaghavPal
      @RaghavPal  7 років тому

      you're welcome Tony, Thanks for watching.

  • @piyushsoni8929
    @piyushsoni8929 6 років тому

    Good and precise tutorial. Thanks.

    • @RaghavPal
      @RaghavPal  6 років тому

      Thanks for watching Piyush

  • @vedantkulkarni6263
    @vedantkulkarni6263 6 років тому

    very useful video thanks a lot

    • @RaghavPal
      @RaghavPal  6 років тому

      You're welcome Vedant.

  • @sharmarocky
    @sharmarocky 6 років тому

    excellent ...explained very simply ...just looking for this ....thanks brother ...subscribed the channel

    • @RaghavPal
      @RaghavPal  6 років тому

      Great to know this Rocky

    • @sharmarocky
      @sharmarocky 6 років тому

      Automation Step by Step - Raghav Pal sir I need your help. I need to use both basic and digest Auth in an test plan.. Pls help. Is there any video of your regarding the same?

    • @sharmarocky
      @sharmarocky 6 років тому

      Automation Step by Step - Raghav Pal sir... In apache jmeter version 2.13, i had a test plan in which i use digest auth. Now when i run the same script in jmtere version 4 (latest). Its not working. I also tested with many permutation and combinations ....but still not working

  • @pauls7670
    @pauls7670 4 роки тому +1

    Hi Raghav. Thanks for great tutorial. For the distributed test using slave machine do we need to copy the Include controller to the slave machine? I saw an error "failed to include controller" on the remote host (slave machine) but the operation in the include controller does not report any error, the response returns 200. When the remote host could not find the include controller shouldn't the operation throws an error instead of giving status 200?

    • @RaghavPal
      @RaghavPal  4 роки тому

      Hi Paul, Ideally there is no need to copy anything from the testplan, you can keep it in master. I will try to check more on this online

  • @vlatkod1065
    @vlatkod1065 4 роки тому

    You are always very helpful. Just one question here, why Test Fragment is disabled - Grey out when is being called? is there any difference if its Enabled? thanks

    • @RaghavPal
      @RaghavPal  4 роки тому +1

      Hi, this is so that the test fragment should not get executed as such, but only when called inside other component like module controller

  • @umabharathyts1998
    @umabharathyts1998 4 роки тому +1

    Great vedio! Thanks
    I have a doubt how to record websockets in jmeter some messages from websockets are not getting recorded ,any help?

    • @RaghavPal
      @RaghavPal  4 роки тому +1

      Hi Uma, there is a websocket sampler, This will help
      www.blazemeter.com/blog/websocket-testing-apache-jmeter/
      www.blazemeter.com/blog/jmeter-websocket-samplers-a-practical-guide/

    • @umabharathyts1998
      @umabharathyts1998 4 роки тому

      @@RaghavPal ya I have added the websocket sampler and recorded but I am getting the response of the websocket in the HTTP. test script recorder and I don't know how to add these response in my recorder controller ,plz help

    • @RaghavPal
      @RaghavPal  4 роки тому +1

      Hi Uma, I have not tried it myself. I will suggest to get some online help on this

    • @umabharathyts1998
      @umabharathyts1998 4 роки тому

      @@RaghavPal Thanks !

  • @indianagriculture3971
    @indianagriculture3971 7 років тому

    Hi Raghav..thank you for you time in making this helpful video.
    Can you also explain about the configuration elements which got added in the test plan from blazemeter's jmx file.
    Also you have implemented API testing in all your videos, can you comment about jmeter's capability for functional testing.
    I want to know if we can do the testing which we do with selenium by using the capabilities of Jmeter;s assertions.
    Thanks

    • @RaghavPal
      @RaghavPal  7 років тому

      Hi, i will make more sessions on these elements.
      Although JMeter may be used for functional testing, however its recommended to use it mostly as a performance testing tool and do functional testing with tools like Selenium.

    • @indianagriculture3971
      @indianagriculture3971 7 років тому

      got it..Thanks..

  • @letuslearnscience-piyushku284
    @letuslearnscience-piyushku284 5 років тому

    Nice video Raghav. Many thanks. I am performing the same scenario which you have performed except that I am playing with teacher's login.
    I got a couple of questions, please give your time.
    1. Why are we using Assertion here?
    2. In my case I have a login with teachers type on the www.typing.com. I have not able to see "user_id" in my response data. It is showing "teacher_id". But when I am checking "teacher_id", it is available only for login request, for other request I am not able to see "teacher_id". Hence I am not able to add assertion with any request other than "login". How to do it?

    • @RaghavPal
      @RaghavPal  5 років тому

      Hi Peeyush,
      1. Assertions are like checks on that we do to verify different aspects like if the response is correct. It may include checking value, size, time etc.
      2. Although it is not very clear to me, you can record this and check your samplers. See this - ua-cam.com/video/zn1DSUZ6t64/v-deo.html

  • @bharatkumar5277
    @bharatkumar5277 6 років тому

    I tried this scenario for sample project. Added 2 include controllers for Login & Logout requests respectively.And simple controller had the other requests.When executed and viewed the results in tree, could see Login 2 times where it is supposed to display once.Not sure if i'm missing something.

    • @RaghavPal
      @RaghavPal  6 років тому

      Hi Bharat, just watch again and compare if you miss something.

  • @ArchanaSharma-cv4lr
    @ArchanaSharma-cv4lr 2 роки тому

    Hi Raghav, I would like to ask if we have a login script and pass multiple users with CSV in that case how we can use the same login script for 2 different modules using a module or Include controller.

    • @RaghavPal
      @RaghavPal  2 роки тому

      Hi Archana, this can help stackoverflow.com/questions/68524472/jmeter-how-to-execute-multiple-csv-data-sets

  • @rohitjha7952
    @rohitjha7952 2 роки тому

    Hi sir, thanks for this videos....but I am having one query is that when i am going to execute the thread group it doesn't execute include controller first it executes simple controller first even after placing include controller before to the simple controller.

    • @RaghavPal
      @RaghavPal  2 роки тому

      Hi Rohit, will need to check the setup

  • @danielchen6688
    @danielchen6688 2 роки тому

    Cool!!!!

  • @hananurrehman
    @hananurrehman 3 роки тому

    What if your application requires using just the authentication token for different API calls
    I don't think one would need a modular approach since just storing the auth_token in a variable using a JSON Extractor would do the trick

    • @RaghavPal
      @RaghavPal  3 роки тому

      Yes Hanan, can check this - ua-cam.com/video/3w0x6u4-6ng/v-deo.html

  • @charankumar9248
    @charankumar9248 6 років тому

    hi raghav
    could u plz explain about module and simple controllers

    • @RaghavPal
      @RaghavPal  6 років тому

      I will try to get a video on that. This can help - jmeter.apache.org/usermanual/component_reference.html#Simple_Controller

  • @Kuldeep5836
    @Kuldeep5836 6 років тому

    Hi Raghav, I have question regarding Login form if there is captcha validation on login page then can we check the load for home pages inside website because each time captcha will be different.?

    • @RaghavPal
      @RaghavPal  6 років тому

      Hi Kuldeep, you cannot and should not automate captcha. Captcha is for preventing automated login attempts, If you are able to automate it then the whole point of having it is lost.
      Normally we handle this by either removing captcha in test environment. Or having a fixed value in test env.

  • @sravaninelavelli604
    @sravaninelavelli604 3 роки тому

    Is it possible to use conditions on assertion

    • @RaghavPal
      @RaghavPal  3 роки тому

      Hi Sravani, may be not directly, can use extractors and if controllers stackoverflow.com/questions/25853672/conditional-response-assertion-in-jmeter

  • @HasithaWaruna1
    @HasithaWaruna1 5 років тому

    Also If I want to distribute user load among these modules is it ok if I use throughput controller with this?

    • @RaghavPal
      @RaghavPal  5 років тому

      Yes, you can Hasitha

  • @s1h2r345
    @s1h2r345 2 роки тому

    How to create a Tets Plan with Login - Student Lessons - Logout, Login - StudentTesst - Logout, Here Login Need to Execute Once and Student Lessons - 5 Times, LOgout Once and similarry the Second Business Process

    • @RaghavPal
      @RaghavPal  2 роки тому

      I will try to do a session

  • @anjalirawat5599
    @anjalirawat5599 5 років тому

    THanks for the video!!! I have 1 question, if i want to create include controller for logout as well,then do i need to create new include controller again and need to change the position of that one as well ??

    • @RaghavPal
      @RaghavPal  5 років тому +1

      Hi Anjali, yes you should be having a separate include controller for logout so you can call it at the end of your scenario.

    • @anjalirawat5599
      @anjalirawat5599 5 років тому

      @@RaghavPal thanks raghav for helping ppl like us.. N replying as well

  • @anilkumarkumar9352
    @anilkumarkumar9352 7 років тому

    Very Good explanation but I tried the same to test my website but it is not working.
    Actually we are CSRF tokens after and before login.What I have done is, I have created three Include controller and a simple controller. But the scripts in Include controllers are dependent on each other so I am not able to login.
    Please help me out ?

    • @RaghavPal
      @RaghavPal  7 років тому

      Hi Anil, i will need to understand your scenario in detail. Can you make use of correlation here.

  • @manojyadav-qd5sd
    @manojyadav-qd5sd 7 років тому

    Hi Raghav..thank you...If you have used login as test fragment, and when we will run test for 50 users then all users will login into app but in result it will show only one time login....Am I right?

    • @RaghavPal
      @RaghavPal  7 років тому

      yes when you save login as test fragment and then refer it through include controller and your other requests are stored in simple controller.

    • @manojyadav-qd5sd
      @manojyadav-qd5sd 7 років тому +1

      Thank you

  • @yazh403
    @yazh403 Рік тому

    If we are passing different users in login, that time how to use include controller

    • @RaghavPal
      @RaghavPal  Рік тому +1

      In JMeter, the Include Controller is used to include external JMX test plans into the current test plan. This can be useful if you want to reuse some of your existing test plan components across multiple test plans.
      If you are passing different users in login, you can use the Include Controller to include a separate test plan for each user. Here are the steps you can follow:
      Create a separate JMX test plan for each user. Each test plan should include the login request(s) for that user.
      Save each test plan to a separate JMX file.
      In your main test plan, add an Include Controller to include the JMX file for each user. To do this, right-click on the Thread Group in the Test Plan tree and select Add > Logic Controller > Include Controller.
      In the Include Controller, specify the path to the JMX file for the user you want to include. You can either specify the path relative to the location of the current test plan file, or you can specify an absolute path.
      Repeat steps 3 and 4 for each user you want to include.
      When you run the test plan, the Include Controller will include the specified JMX files for each user, effectively simulating multiple users logging in with different credentials.
      Note that you will need to configure your login requests to use the credentials passed in by each user, such as by using JMeter Variables or CSV Data Set Config. Additionally, you may want to use the Loop Controller to repeat the login requests for each user multiple times, to simulate multiple iterations of the login process.

  • @jatingirdhar1589
    @jatingirdhar1589 3 роки тому

    Hi Sir, What is .svg under Thread Group > Test in a Test Plan ? Thanks in advance. It appeared while I was doing recording for typing.com site.

    • @RaghavPal
      @RaghavPal  3 роки тому +1

      Hi Jatin, its an image format SVG: Scalable Vector Graphics

    • @jatingirdhar1589
      @jatingirdhar1589 3 роки тому

      @@RaghavPal Thanks sir.

  • @A.B.00007
    @A.B.00007 5 років тому

    My recorded pages (Lessons / Tests) in this script does not included "user_id" as your script. Only (Login Page) has it. Any Idea why this difference is taking place?

    • @RaghavPal
      @RaghavPal  5 років тому

      Hi Asif, it may be due to application changes. do not worry if it is working fine

  • @rashmiambedkar5143
    @rashmiambedkar5143 7 років тому

    Can You a create a tutorial with HTTP authorisation Manager, when we use cookie and when we wont. Please provide a real project example. i.e short framework

    • @RaghavPal
      @RaghavPal  7 років тому

      sure Rashmi, i will do it in some time.

  • @pomitwadhawan539
    @pomitwadhawan539 6 років тому

    Is it possible to call a script in a different jmx file from current jmx file ?
    Eg. I have login script present in login.jmx and I am running student_test.jmx which does not have login script inside it. I want to login first using login.jmx and then continue other functions through student_test.jmx.

    • @RaghavPal
      @RaghavPal  6 років тому

      Hi Pomit, you should be able to do so using controllers like include controller. This can help - ua-cam.com/video/jKiZ1efpE5w/v-deo.html
      www.jmeter-archive.org/Calling-jmx-file-inside-jmx-file-td5714136.html

  • @rahulrana892
    @rahulrana892 6 років тому

    How to use this if different login ids give different access ???

    • @RaghavPal
      @RaghavPal  6 років тому

      Rahul then you have to save you login scripts separately and include them as per need in your thread groups. You can have multiple thread groups too

    • @rahulrana892
      @rahulrana892 6 років тому +1

      Automation Step-by-Step - Raghav Pal got it... thanks

  • @hemaharsh2381
    @hemaharsh2381 5 років тому

    Hi Raghav . Hope your doing well ! Iam stuck in one issue . There is code written in python ans using Js223 processor, iam trying to pass variable values in my json file ( HTTP request ) . But I have received Dateutile module error which I was call in my python code ( code is working in python and Jython envo) . Later , I installed dateutil module and call in import sys and found the unsupported operand type(s) for +: 'java.sql.Timestamp' and 'timedelta' in . Is it require to convert this code into java undersatnd format . Can u suggest steps how to installed additional python or jython packages

    • @RaghavPal
      @RaghavPal  5 років тому

      Hi Hemaharsh, I will need to see your setup and logs

    • @hemaharsh2381
      @hemaharsh2381 5 років тому

      ​@@RaghavPal sure . The problem is basically using python code in the jmeter . the code basically use the python date time, timedelata and parser modules . however, its working with stand alone python 2.7.0. The j meter displays errors like, javax.script.ScriptException: AttributeError: 'java.sql.Timestamp' object has no attribute 'isoformat', unsupported operand type(s) for +: 'java.sql.Timestamp' and 'timedelta' . I have seen either problem like date time string format mismatched or packages are not recognized .Hope this clarifies .I have seen this link : It may helpful bugs.jython.org/issue1709

    • @RaghavPal
      @RaghavPal  5 років тому

      I will need to study and analyze this and will need some time for this. I will try to take out time soon, but pls keep looking for solutions online and try. Also see if there can be a better alternative way to do this.

    • @hemaharsh2381
      @hemaharsh2381 5 років тому +1

      @@RaghavPal Hopefully you have clarity on problem Iam facing . Yes sure . Thanks for your positive reply !

  • @annieanithaalfred7690
    @annieanithaalfred7690 7 років тому

    My login is been executed n times for n users. I am expecting a single login in result tree for n users. Is it possible? Please help...

    • @RaghavPal
      @RaghavPal  7 років тому

      You can use Only Once controller

    • @annieanithaalfred7690
      @annieanithaalfred7690 7 років тому

      But when used Once Only Controller when we have n users still it login runs n times. I am having it as Thread group..Once only controller..Login ...Simple Controller ..other pages. I have cookies being passed from login page, so it throws error when using 2 thread groups. I tried solutions mentioned in stackoverflow.com/questions/35745431/jmeter-how-to-share-cookies-between-threads. But it didn't work for me.

    • @RaghavPal
      @RaghavPal  7 років тому

      Hi Annie, just missed your last comment. Sorry for that. In case you are still struggling with this issue, you can send me your jmx file and log file with issue details at raghav.qna@gmail.com. I will try to check asap.