Wednesday, February 3, 2010

Tip #5: How to run a test plan for a certain amount of time

If you want to run your Test Plan for a certain amount of time instead of a certain amount of iterations you can do it in two ways:
  • by specifiing testing duration on the Thread Group GUI (Scheduler checkbox must be checked). Note that you must specify the value of Startup delay option as zero otherwise you will need to specify Start Time option value before each test running. And of course you need to check Forever checkbox of Loop Count option. There is 10 minutes test example on the screenshot below.

  • by creating extra Thread Group with two Test Action samplers. The first Test Action configured as pause, and the seconf one is configured to stop all treads. Look at the screenshots below for 10 minutes test example.







    17 comments:

    1. very, very nice. I will use it.

      ReplyDelete
    2. thats great but do we have an option to schedule the jmeter.
      for example start the test plan pause it for few minutes and then again start it,without manually starting it

      ReplyDelete
      Replies
      1. I have used batch (.bat) script to run jmeter script with arguments as scheduler and that work like a charm for me.

        So my vote is to use batch file

        Regards,
        mohit
        http://mkbansal.wordpress.com/

        Delete
    3. That can be done by scripts. I prefer 'rake' for this.

      ReplyDelete
    4. Thanks a lot for the tip,
      can you guide me further about the "rake",sorry i am just a starter in jmeter

      ReplyDelete
    5. i want to schedule jmeter like that it should run test thread automatically after every 1 or 2 hrs

      ReplyDelete
    6. Anonymous,
      you can do it using cron.

      ReplyDelete
    7. i m new in testing.can u give brief description about cron.can we do using jmeter or selenium

      ReplyDelete
    8. Without your help I can't complete my test plan. You explained properties and variables in good way and easy to understand. Thanks

      ReplyDelete
    9. how can we stop only one thread group during the test, where as other thread group should continue the test. Please suggest

      Regards,
      Praneet

      ReplyDelete
      Replies
      1. Not sure how to stop the whole group in one action.
        You can try to play with this: select "Current thread" item of the "Target" option in Test Action settings. This will stop current thread (not the whole group).

        Delete
    10. Hi Victor ,
      I have created a test plan to check google.com and I gets the result with an average response time as '8500'milsec e for thread group 100 and ramp up period '0'. Actually we know that google loads with in milliseconds ,So the response time will be less than 1minite .But from Jmeter we gets this wrong result.Or what does it mean?

      ReplyDelete
      Replies
      1. JMeter shows the right results. When you go to google's website through the browser it loads the page in one thread. In this case response time will only depend on your network connection speed. If you run the test plan with 100 threads in JMeter response time depends on few more things, i.e. connection bandwidth, server and local side hardware, etc. Also zero ramp-up period redoubles this problem.
        BTW, that's not good practice to load others' servers.

        Delete
    11. Dear Victor,

      I am trying to make a 24hrs web performance test by JMeter tool,
      can you please explain what does the S{_P(users)} stands for?
      I would like to have 10users, so how do I do?

      many thanks
      alc008

      ReplyDelete
      Replies
      1. This is property. You can ready about it here: http://jmeter-tips.blogspot.com/2010/01/tip-4-using-jmeter-properties.html

        Delete