[英]Jmeter Integration with Ant- How to send the html report from ant from email
我已經為Jmeter配置了build.xml並生成了html報告。 我想在執行測試后將此報告作為附件發送到電子郵件中。 任何人都可以幫忙。
您如何觸發執行? 通過詹金斯? 如果沒有,我建議您使用Jenkins觸發執行並處理電子郵件部分。
下面的文章准確地解釋了您要尋找的東西!
http://www.testautomationguru.com/jmeter-continuous-performance-testing-part2/
您可以添加Ant Mail Task ,以便通過電子郵件發送生成的報告,該示例需要對示例build.xml文件進行修改(您可以在JMeter安裝的“ extras”文件夾下找到一個)
<target name="send-email" depends="xslt-report">
<mail user="johndoe@gmail.com"
password="secret"
ssl="yes"
mailhost="smtp.gmail.com"
mailport="465"
subject="JMeter Test Results">
<to address="recipient@example.com"/>
<from address="johndoe@gmail.com"/>
<attachments>
<fileset dir="/path/to/test/results">
<include name="**/*.html"/>
</fileset>
</attachments>
</mail>
</target>
如果您對Ant不太熟悉,則可以使用單個SMTP采樣器創建第二個JMeter測試計划,並將其配置為將郵件測試計划生成的.html結果發送給指定的收件人。 請參閱文章負載測試電子郵件服務器:如何使用JMeter發送和接收電子郵件,有關設置JMeter以發送電子郵件的更多信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.