0
votes

I have been trying to do a nested API call Where in my calls as to go like this-

  1. first call - 1 time
  2. second call - n number of times (usually 800)
  3. third call- 1 time

The API would be the same and the request body differs-

first call -

{
    "id" : 1,
    "last" : false ,
    "value" : "" ,
    "order" : 0
}

second call -

{
    "id" : 1,
    "last" : false ,
    "value" : "A" ,
    "order" : 1 to n 
}

third call -

{
    "id" : 1,
    "last" : true ,
    "value" : "" ,
    "order" : 1
}

My CSV looks like this -

file-1

id
1
2
3
4
5

file-2

order value
1 A
2 B
3 C
4 D
5 E

File-1: I pick id from file 1 which is used in all three calls.

File-2: I pick order and value which is to be looped n number of times.

I want the execution to happen like this -

 for() {
       // first call
        for() {
           // second call
        }
      // third call
    }

When I do this with my JMeter configuration -

Thread ends at second call ( end of CSV file content ), I'm not able to make 3rd API call.

enter image description here

Thanks in advance

1

1 Answers

0
votes
  1. Make sure that your CSV Data Set Config has both Recycle on EOF and Stop thred on EOF set to False

    enter image description here

  2. Instead of using Loop Controller switch to While Controller and use the following __jexl3() function as the condition:

     ${__jexl3("${myVar}" != "<EOF>",)}
    

    enter image description here