JMeter - send HTTP request name in email header

Using jmeter 3.3 I am sending a request to my an site according to the approval of KO I am sending an email.

For this, I added an IF controller with this condition:

!${JMeterThread.last_sample_ok}

inside my if I start an email using SMTP Sampler.

Please, how can I send the sampler HTTP request name in the email header?

thank

+4
source share
1 answer

Given that you have a setting, for example:

  • Your sampler
    • Statement
  • If the controller
    • SMTP Sampler

You can get the name Your samplerusing the __ groovy () function , for example

${__groovy(ctx.getPreviousSampler().getName(),)}

Demo:

JMeter Groovy Previous Sample Name

: Apache Groovy -

+6

Source: https://habr.com/ru/post/1692316/


All Articles