How to jmeter testreport sent mail

To generate a test report and send it via email using JMeter, you can follow these steps:

Step 1: Configure JMeter to generate a test report

  1. In your JMeter test plan, go to the "Test Plan" tree and right-click on the "Test Plan" node.
  2. Select "Add" > "Listener" > "Aggregate Report" to add an Aggregate Report listener to your test plan.
  3. Configure the Aggregate Report listener to generate a report in the format you prefer (e.g., CSV, XML, etc.).

Step 2: Configure JMeter to send the test report via email

  1. In your JMeter test plan, go to the "Test Plan" tree and right-click on the "Test Plan" node.
  2. Select "Add" > "Post-Processor" > "SMTP Sampler" to add an SMTP Sampler to your test plan.
  3. Configure the SMTP Sampler to send an email with the test report attached.

Here's an example of how to configure the SMTP Sampler:

Step 3: Run your JMeter test

  1. Run your JMeter test by clicking the "Start" button or by using the command-line option -t followed by the name of your test plan.
  2. JMeter will execute your test and generate a test report.
  3. The SMTP Sampler will send the test report via email to the specified email address.

Example JMeter configuration file

Here's an example JMeter configuration file (jmeter.properties) that demonstrates how to configure JMeter to generate a test report and send it via email:

# Aggregate Report listener configuration
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.request_header=false
jmeter.save.saveservice.response_header=false
jmeter.save.saveservice.response_data=false
jmeter.save.saveservice.assertions=false
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.failed=true
jmeter.save.saveservice.error=true

# SMTP Sampler configuration
jmeter.smtp.server=smtp.example.com
jmeter.smtp.port=587
jmeter.smtp.username=myemailusername
jmeter.smtp.password=mypassword
[email protected]
[email protected]
jmeter.smtp.subject=JMeter Test Report
jmeter.smtp.body=This is a test report generated by JMeter.
jmeter.smtp.attachment=jmeter-results.csv

In this example, the Aggregate Report listener is configured to generate a CSV file named jmeter-results.csv. The SMTP Sampler is configured to send an email with the test report attached to the specified email address.