3
votes

I am trying to load test my app by setting the Start and end time in Scheduler as a variables eg:

Start Time : ${START_TIME}
End Time : ${END_TIME}

bit Jmeter is not allowing to save it.Is it not a configurable option ?

This is what I want to do

jmeter -Jduration=600 -n -t /path/to/your/test/plan.jmx

This will kick of the tests immediately for 10 mins (600s) Can the start time be configured in such a way that it is always a current time

1

1 Answers

4
votes

You can configure it but it has to be a valid Date

If you want to control duration of your test I would recommend the following:

  1. Test Start Time can be set by OS means (cron jobs, scheduled tasks, continuous integration system build plan, etc.)
  2. Test Duration can be set via JMeter Property.

For instance, you want your test to run for 2 hours. In order to achieve this you need to provide the value of "7200" into "Duration" section of thread group. If you put ${__property(duration,,)} or ${__P(duration,)} into "Duration" input of thread group and set this duration=7200 property in i.e. user.properties or jmeter.properties files (they both live under /bin folder of your JMeter installation) or provide it as a command-line argument as

jmeter -Jduration=7200 -n -t /path/to/your/test/plan.jmx -l /path/to/results/file.jtl

The test will run for 2 hours (plus some additional time to gracefully shut down all the test threads).

See Apache JMeter Properties Customization Guide for more details on JMeter Properties use cases.