0
votes

All, I need additional assistance. I have tried researching and was using this following resource guide. https://www.blazemeter.com/blog/using-while-controller-jmeter

Problem

I need to Implement a way to wait for a specific Response from the server and record the time it takes from the start of the request to the end where I get a response of Complete in Jmeter. I have been looking at while controller and researching it.

Problem#1 If I add a while controller, my request failed because its adding multiple token. If I leave it without the while controller then it only gets 1 bearer token and it is able to submit a get request and get the response appropriately. I am suspecting there is a pre-procession somewhere else in my script that doing this...

enter image description here

Uses beanshell preprocesser to grab the token

sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("BEARER")));

Problem #2

I have a GET Request to check the status of the request. Response in the BODY comes back as this json "{"Status": "RECEIVED", "DllUrl": "", "Message": " "}"

I need it to continue checking for the status of COMPLETE……..also may need to check for failed as well

Was looking at regular Expression extractor to get the status and only stop until it finds COMPLETE status. That way I can measure time start and end time for completion. Any help and guidance will be helpful.

1

1 Answers

0
votes

You're adding a header and not removing the previous one therefore it adds another header on each iteration.

In fact you don't need to do any scripting for this, you can just define the header in the HTTP Header Manager:

enter image description here

With regards to extracting this Status value, it's better to do it using JSON Extractor configured like:

enter image description here

Once done you can use the following __jexl3() function to "wait" till the operation finishes:

${__jexl3("${status}" != "COMPLETE",)}

enter image description here