vins
vins

Reputation: 37

How to send the Assersion failure emails and end of test results via email in Jmeter?

link for jmeteri am using jmeter for my testing. I am finding it hard to find a way to send an email to my account when an assertion fails. Or when the job is complete, i want the results sent to my email. How can i do that?

Upvotes: 0

Views: 1123

Answers (1)

Dmitri T
Dmitri T

Reputation: 168157

You can send an email with JMeter using SMTP Sampler. Something like:

  • If Controller, condition ${JMeterThread.last_sample_ok}==false
    • SMTP Sampler

See Load Testing Your Email Server: How to Send and Receive E-mails with JMeter article for details on how to configure SMTP Sampler

Results can be send in the similar way.

  1. Add the following line to user.properties file (lives in JMeter's "bin" folder)

    jmeter.save.saveservice.autoflush=true
    

    This is required to configure JMeter to save results into a file as soon as they're available in order to ensure you won't miss a single request results

  2. Add tearDown Thread Group to your Test Plan. tearDown Thread group is being executed after all other Thread Groups

  3. Add SMTP Sampler as a child of the tearDown Thread Group and configure it to send .jtl results file to the specified email(s)

Upvotes: 2

Related Questions