本文介绍了正则表达式提取器Jmeter-我想发送404响应代码的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个测试用例,如果响应代码为404,它将击中URL并发送电子邮件.请求进行得很好,响应也来了,但是我被正则表达式提取器困住了.

I am writing a test case which will hit a URLs and send email if response code is 404. Request is going well and Response also coming but I am stuck at Regular Expression Extractor.

!! [HTTP请求的示例结果] [提取器页面]

推荐答案

  1. 将您的正则表达式修改为\d+
  2. 添加如果是控制器在着陆页验证"请求之后,并以"${responsemsg}" == "404"作为条件
  3. 使SMTP Request采样器成为If Controller的子代
  1. Amend your Regular Expression to be \d+
  2. Add If Controller after the "Landing Page Verification" request and use "${responsemsg}" == "404" as the condition
  3. Make SMTP Request sampler a child of the If Controller

示例测试计划快照

这篇关于正则表达式提取器Jmeter-我想发送404响应代码的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 15:22