0
votes

I'm using a jmeter script with while controller condition as

${__javaScript("${status}"=="Progress")}

Followed by one http request and from that request again I will extract the status. If the status is progress it will contine one http request inside loop else if the status success it will exit the loop. But i want to add assertion to ensure whether I get the status as success in the http request or not.

Because if i use assertion as Success in that http sampler, it checks all the reqest and obviously it will return false, and i need to add assertion only to the final http sampler of the while controller.

And so I can get error percentage with failing request in aggregate report and view results tree . Can anyone share your ideas please.

1

1 Answers

0
votes

I would recommend using Response Assertion to verify if ${status} variable value is Progress OR Success

  1. Add Response Assertion as a child of the HTTP Request sampler
  2. Configure it as follows:

    • Apply to: -> JMeter Variable -> status
    • Pattern Matching Rules: Matches
    • Patterns to Test: Progress|Success

      JMeter Response Assertion 2 Clauses

Given you use "Matches" rule JMeter will treat the pattern as a Perl5-style regular expression so if ${status} variable will be equal to Success or Progress the sampler will pass and otherwise it will be marked as failed.

See How to Use JMeter Assertions in Three Easy Steps article to learn more about using Assertions in Jmeter tests.