skip to Main Content

I have an API that returns the following json:

{
    "GetAppendixListResponse": {
        "GetAppendixListResult": {
            "FileList": {
                "string": ["3602","3587"]
            },
            "Code": "0"
        }
    }
}

The debug sampler looks like:

JMeterVariables:
AppendixCode_1=["3602","3587"]
AppendixCode_ALL=["3602","3587"]
AppendixCode_matchNr=1

How can I convert ["3602","3587"] from string to a list (for loop_controller)?

2

Answers


  1. convert AppendixCode_1 to array. and use it in loop controller .

    Login or Signup to reply.
  2. Add JSON JMESPath Extractor as a child of the request which returns the above JSON and configure it like:

    enter image description here

    This way you will be able to see the following JMeter Variables in the Debug Sampler:

    AppendixCode_1=3602 
    AppendixCode_2=3587
    AppendixCode_matchNr=2
    

    Hence the variables could be used in the ForEach Controller

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search