Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited title
Link
Michael Durrant
  • 25.2k
  • 3
  • 41
  • 113

While loop does not Jmeter get requests failing to exit for existing response

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
deleted 220 characters in body
Source Link

I want to let jmeterJMeter exit while controller when response value "model_name": "Model-Test-2022-02Corpus-24T04:34:32454JMeter2-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-Test-2022-02Corpus-24T04:34:32454JMeter2-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 followings:while controller condition ${__jexl3("${model_name}" != "Model-Corpus-JMeter2-0001-v1-8k",)}

  1. user defined variable modelnameresult = Model-Test-${variable}-0001-v1-8k (the ${variable} was set in previous request Test-${__time(yyyy-MM-dd'T'hh:mm:ssSSS,variable)}-${counter}

  2. while controller condition ${__jexl3("${model_name}" != "${modelnameresult}",)}

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 hereenter image description here

enter image description hereenter image description here

I want to let jmeter exit while controller when response value "model_name": "Model-Test-2022-02-24T04:34:32454-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-Test-2022-02-24T04:34:32454-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 followings:

  1. user defined variable modelnameresult = Model-Test-${variable}-0001-v1-8k (the ${variable} was set in previous request Test-${__time(yyyy-MM-dd'T'hh:mm:ssSSS,variable)}-${counter}

  2. while controller condition ${__jexl3("${model_name}" != "${modelnameresult}",)}

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.

enter image description here enter image description here

enter image description here

enter image description here

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

deleted 125 characters in body
Source Link

I want to let jmeter exit while controller when response value "model_name": "Model-Test-2022-02-24T04:34:32454-0001-v1-8k" is found in response data.

sample response data:

{
    "message": "success", 
    "valid_model_list": [{
    {
        "meta_data": {
                "corpus_list": [
          "Test-2022-02-15T01:38:57.000337-0001"          "test1"
                ], 
                "id": "1",
        },        "sample_rate": 16000,
                "test_duration": "0.17 hrs"
            }, 
            "model_name": "Model-Test-2022-02-24T04:34:32454-0001-v1-8k", 
            "status": "ok"
        },
        {
            "meta_data": {
                "corpus_list": [
          "Test-2022-02-15T01:38:57.000337-0001"          "test1"
                ], 
                "id": "2",
        },        "sample_rate": 16000,
                "test_duration": "0.17 hrs"
            }, 
            "model_name": "testmod2-v1-8k", 
            "status": "ok"
    }    }
    ]
}

I have set followings:

  1. user defined variable modelnameresult = Model-Test-${variable}-0001-v1-8k (the ${variable} was set in previous request Test-${__time(yyyy-MM-dd'T'hh:mm:ssSSS,variable)}-${counter}

  2. while controller condition ${__jexl3("${model_name}" != "${modelnameresult}",)}

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.

enter image description here enter image description here

enter image description here

enter image description here

enter image description here

I want to let jmeter exit while controller when response value "model_name": "Model-Test-2022-02-24T04:34:32454-0001-v1-8k" is found in response data.

sample response data:

{
  "message": "success", 
  "valid_model_list": [
    {
      "meta_data": {
        "corpus_list": [
          "Test-2022-02-15T01:38:57.000337-0001"
        ], 
        "id": "1"
        }, 
        "test_duration": "0.17 hrs"
      }, 
      "model_name": "Model-Test-2022-02-24T04:34:32454-0001-v1-8k", 
      "status": "ok"
    },
    {
      "meta_data": {
        "corpus_list": [
          "Test-2022-02-15T01:38:57.000337-0001"
        ], 
        "id": "2"
        }, 
        "test_duration": "0.17 hrs"
      }, 
      "model_name": "testmod2-v1-8k", 
      "status": "ok"
    } 
  ]
}

I have set followings:

  1. user defined variable modelnameresult = Model-Test-${variable}-0001-v1-8k (the ${variable} was set in previous request Test-${__time(yyyy-MM-dd'T'hh:mm:ssSSS,variable)}-${counter}

  2. while controller condition ${__jexl3("${model_name}" != "${modelnameresult}",)}

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.

enter image description here enter image description here

enter image description here

enter image description here

enter image description here

I want to let jmeter exit while controller when response value "model_name": "Model-Test-2022-02-24T04:34:32454-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-Test-2022-02-24T04:34:32454-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 followings:

  1. user defined variable modelnameresult = Model-Test-${variable}-0001-v1-8k (the ${variable} was set in previous request Test-${__time(yyyy-MM-dd'T'hh:mm:ssSSS,variable)}-${counter}

  2. while controller condition ${__jexl3("${model_name}" != "${modelnameresult}",)}

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.

enter image description here enter image description here

enter image description here

enter image description here

Source Link
Loading