[英]Retry logic in Jmeter script
How to implement retry logic in jmeter script based on the response code got in a request. 如何基于请求中获得的响应代码在jmeter脚本中实现重试逻辑。 Example if i am getting 409 response code, how i resend the same request for given number of iteration?
例如,如果我得到409响应代码,如何在给定的迭代次数下重新发送相同的请求?
Put your request under the While Controller and use the following __groovy() function as the condition: 将您的请求放在While控制器下,并使用以下__groovy()函数作为条件:
${__groovy((vars.get('statusCode') == null || vars.get('statusCode').equals('409')) && ((vars.get('__jm__While Controller__idx') as int) < 5),)}
Add Regular Expression Extractor as a child of your request and configure it like: 将正则表达式提取器添加为您的请求的子项,并将其配置为:
More information: Using the While Controller in JMeter 详细信息: 在JMeter中使用While控制器
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.