Nested loops with steps


Could you tell me please how to write a scenario with nested loops:
Run 4 times: N = 5, 10, 15, 20
1) Execute N Post requests
2) Execute N Delete requests
3) Repeat steps 1 & 2 above 5 times

Thanks in advance.


val loopNum = Seq(5,10,15,20)

val scn = scenario(“loop”)
.foreach(loopNum, “i”) {

The above code should help in achieving your requirement
the foreach loop will iterate through the Sequence variable loopNum and get each values and store in session variable i
the repeat loop iterates to the times of value of i which will be 5,10,15,20 to execute post and delete requests


Sujin Sam

Hello, Sujin Sam.

Thank you very much for your quick response and clear explanation!
Your script helped me with my task.

вт, 18 авг. 2020 г. в 08:21, sujin sam <>: