How to implement a nested loop in jmeter?

I am thinking about how to test a servlet with two parameters: X and Y using JMeter.

X and Y are random numbers from 0 to 100.

I am thinking of a nested loop implementation, something like

for (int x = 0; x <= 100; x++)
    for (int y = 0; y <= 100; y++)
        servlet?param1=x&param2=y

Can someone give a hint on how to implement this using Counterand Loop Controlleror something else?

+3
source share
1 answer

Your circuit might look like this:

    Thread Group 
        User Defined Variables
        maxX = 100
        maxY = 100
        Loop controller x
        Loop Count: $ {__ BeanShell (Integer.parseInt (vars.get ("maxX")) + 1)}
        Counter x
        Start: 0
        Increment: 1
        Maximum: $ {maxX}
        Reference Name: loopX
            Loop Controller Y
            Loop Count: ${__BeanShell(Integer.parseInt(vars.get("maxY"))+1)}
            Counter Y
            Start: 0
            Increment: 1
            Maximum: ${maxY}
            Reference Name: loopY
                    YOUR HTTP Request
                    servlet?param1=${loopX}&param2=${loopY}
                    . . .

enter image description here

, CSV :
Looping 2 CSV

+6

Source: https://habr.com/ru/post/1547775/


All Articles