1
votes

I want to create a controller that should run a till the condition fails. How it can be implemented in Jmeter.

The controller should contain a HTTP Request with a post body which is dynamic the request should continue till the condition fails,but i dont know where the should i apply that condition.

{
  "access": {
    "identifier": "9876f",
    "Reproduce": "Right",
    "possible": {
      "id": "u7ur038",
      "value": "Move"
    }
  }
}

If the response "Reproduce" contain "Right"then it should run again HTTP Request for new body and If the response "Reproduce" contain "Wrong"then it should stop executing.

1

1 Answers

1
votes

You can use a While Controller which will contain your request.

Condition of While Controller will be:

${__jexl3("${response}" != "Wrong")}

Add as child of your HTTP Request a JSON Extractor:

  • Names of created variables: response
  • JSON Path Expressions: $..Reproduce
  • Match No.: 1

To reset variable for next thread loop iteration, add before While Controller a Flow Control Action and put inside it a preprocessor called User Parameters .

Click « Add Variable » and set :

  • Name: response
  • User_1: Right