JMeter:结果/报告通过电子邮件发送? [英] JMeter: Result/Report Emailing?

查看:628
本文介绍了JMeter:结果/报告通过电子邮件发送?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让JMeter在运行测试计划后通过电子邮件将结果发送给我,该计划计划每天运行,无论成功或失败以及测试用例.

I am trying to get JMeter to email me the results after it runs a test plan which is intended to be run daily with success or fail and the test cases.

在文档中指出"JMeter具有广泛的电子邮件功能.它可以根据测试结果发送电子邮件" [1],但是我什么也找不到.经过一些研究,可能会出现用bean脚本编写脚本的可能性(但要再次获取实际结果很困难),以便通过电子邮件发送电子邮件或在cron上运行批处理文件.

In the documentation it state "JMeter has extensive Email capabilities. It can send email based on test results"[1], But I cant find anything. After some research there is possibility popping up in writing a script in bean script(but grabbing the actual results is difficult again) to email or running a batch file on a cron.

问题:这是唯一的选择吗? JMeters的文档含糊地暗示,可能有一种内置的方法可以通过可选的添加项(我已经添加)来做到这一点,但是从那里没有任何指导.[2]我缺少明显的东西吗?

The Question: Is this the only option? JMeters documentation vaguely suggests that there may be a built in way to do this through optional additions (which i have added) but no directions from there.[2] Am I missing something obvious?

[1] http://jmeter.apache.org/usermanual/get-started .html

[2] http://www.jajakarta .org/jmeter/1.7/en/usermanual/get-started.html#opt_email

推荐答案

JMeter随附 SMTP采样器,可用于发送带有任意内容的电子邮件,例如在测试结束或发生错误或达到临界阈值时.

JMeter comes with SMTP Sampler which can be used to send an email with arbitrary content for instance when test has ended or error occurred or critical threshold is reached.

理论上,您可以配置SMTP Sampler发送.jtl结果文件,即在 tearDown线程组中的某个位置,但不能保证结果将是完整的.

Theoretically you can configure SMTP Sampler to send .jtl results file i.e. somewhere in tearDown Thread Group but there is no guarantee that results will be full.

JMeter具有jmeter.save.saveservice.autoflush属性,默认为"false",因此JMeter定期将结果存储在.jtl文件中(不是实时).您可以将其设置为"true",以使电子邮件获得更一致的结果-在这种情况下JMeter会记下每一行,但是如果负载很大,可能会导致大量的磁盘IO开销.

JMeter has jmeter.save.saveservice.autoflush property which defaults to "false" so JMeter periodically stores results in .jtl file (not in the real time) You can set it to "true" to get more consistent results to email - in that case JMeter will write down every single line, however in case of immense load it may lead to massive disk IO overhead.

请参见加载测试电子邮件服务器:如何使用JMeter发送和接收电子邮件指南,例如SMTP采样器配置.

See Load Testing Your Email Server: How to Send and Receive E-mails with JMeter guide for example SMTP Sampler configuration.

如果您决定将autoflush属性设置为true,最好的方法是将以下行添加到 user.properties 文件(位于JMeter安装目录的/bin文件夹中)并重新启动JMeter

If you decide to set autoflush property to true, the best way is to add the following line to user.properties file (in /bin folder of your JMeter installation) and restart JMeter

jmeter.save.saveservice.autoflush=true

您还可以通过-J键将其作为命令行参数提供,例如

You can also provide it as command-line argument via -J key like

jmeter -Jjmeter.save.saveservice.autoflush=true -n -t /path/to/testplan.jmx -l /path/to/results.jtl

这篇关于JMeter:结果/报告通过电子邮件发送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆