Regular Expression Extractor Jmeter - I want to send email for 404 response codes

喜你入骨 提交于 2019-12-14 03:55:02

问题


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.Sample Request Result

![Sample Result for HTTP Request][Extractor Page]


回答1:


  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

Example Test Plan snapshot




回答2:


Change the regular expression to (\d+) and template to $1$ and match no. to 1. see using regex with jmeter and Regular Expressions from jmeter user manual for more information.



来源:https://stackoverflow.com/questions/43845778/regular-expression-extractor-jmeter-i-want-to-send-email-for-404-response-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!