JMeter timers not waits the time configured in sampler

Viewed 361

I try to create a scenario that I put a user defined delay in my test.

  1. In the start of the test I created JSR sampler and created a variable called vertica_results_delay and put in it the value of 400000. Than I crated a timer and put ${vertica_results_delay}, since I want the delay will be configured in the start of the test, the problem is that Jmeter ignores my value, and not wait. If I used Use defined field and put vertica_results_delay = 4000 it worked, but than all the tests will get the same delay, I do not want to create hard coded delay. I want to enter all properties of the test in the start of the test using JSR.

    String vertica_results_delay = "400000"; vars.put("vertica_results_delay", vertica_results_delay); log.error("vertica_results_delay " + vertica_results_delay);

enter image description here enter image description here

enter image description here

enter image description here

2 Answers

Check JMeter order of execution

  1. Configuration elements
  2. Pre-Processors
  3. Timers
  4. Sampler

Your sampler executed after Timer, you need to set it before,

Add JSR223 PreProcessor outside Thread Group with your code and the delay value will be set before Timer is executed.

Related