1
votes

I Have 5 HTTP request in single thread, I want to run first request multiple times and then other request only single time

I can't use multiple thread as all request are depends on each other.

2

2 Answers

1
votes

Put first request under Loop Controller with Loop Count as the times you want to repeat

JMeter will loop through them a certain number of times, in addition to the loop value you specified for the Thread Group. For example, if you add one HTTP Request to a Loop Controller with a loop count of two, and configure the Thread Group loop count to three, JMeter will send a total of 2 * 3 = 6 HTTP Requests.

Choose request(s) you want to execute multiple times and then:

Right Click -> Insert Parent -> Logic Controller -> Loop Controller

1
votes

Depending on what you're trying to achieve:

  1. Put the request which needs to be run only once under Once Only Controller, this way the Sampler will be executed only during first iteration of the Thread Group

    enter image description here

  2. If you want more complex/flexible criteria - put the request which needs to be executed only once under the If Controller, this way you will be able to specify whatever criteria you want. For example if you want to run a Sampler only during 5th iteration use the following condition:

    ${__jexl3("${__jm__Thread Group__idx}" == "5",)}
    

    enter image description here

    this way the sampler(s) which is (are) under the If Controller will be executed only if the condition is met:

    enter image description here