Skip to main content
4 of 4
edited title
Michael Durrant
  • 25.2k
  • 3
  • 41
  • 113

Jmeter get requests failing to exit for existing response

I want to let JMeter exit while controller when response value "model_name": "Model-Corpus-JMeter2-0001-v1-8k" is found in response data.

sample response data:

{
    "message": "success",
    "valid_model_list": [{
            "meta_data": {
                "corpus_list": [
                    "test1"
                ],
                "id": "1",
                "sample_rate": 16000,
                "test_duration": "0.17 hrs"
            },
            "model_name": "Model-Corpus-JMeter2-0001-v1-8k",
            "status": "ok"
        },
        {
            "meta_data": {
                "corpus_list": [
                    "test1"
                ],
                "id": "2",
                "sample_rate": 16000,
                "test_duration": "0.17 hrs"
            },
            "model_name": "testmod2-v1-8k",
            "status": "ok"
        }
    ]
}

I have set while controller condition ${__jexl3("${model_name}" != "Model-Corpus-JMeter2-0001-v1-8k",)}

The JSON expression is tested works to extract a list of "model_name".

however, the GET request isn't exiting when the response value is already there.

Debug Sampler: captured model_name_18=Model-Corpus-JMeter2-0001-v1-8k

enter image description here enter image description here

enter image description here

enter image description here