Software Quality Assurance & Testing Asked by M Thurman on December 25, 2020
I have a situation where I need to pause all of the threads to a particular endpoint when I receive a specific error code from the response. So I basically need to look for this error code (ex. 404) and pause for a random num of secs b/t 3 and 10. Below is my current test structure. I have looked at the logic controllers but I am unsure how to implement. I assume that I would need to wrap each request with this logic. Thanks for your help!
Matt
Add Regular Expression Extractor as a child of the HTTP Request sampler which code you need to extract and configure it as follows:
it will save response code of the sampler into ${code}
JMeter Variable
Add If Controller after this sampler and use the following __jexl3() expression:
${__jexl3(${code}==404,)}
it means that If Controller's children will only be executed if the Sampler will fail with 404
status code
Add Flow Control Action sampler as a child of the If Controller and configure it as follows:
this ${__Random(3000,8000,)}
function will generate random think time between 3000 and 8000 milliseconds which seems to be exactly what you're looking for
Answered by Dmitri T on December 25, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP