Jenkins+Jmeter integrates automated interface testing and sends test reports by email

1. Jenkins configuration

1. Add a free style project

2. Build -> Select Excute Windows batch command (because I tried it locally, I chose windows)

3. Input steps:

    1. Since you cannot have the same jtl file, you need to delete the jtl file before each build

    2. The report folder generated by jmeter must be empty, so delete the folder and create a new report folder before each build

    3. In non-GUI mode, execute jmeter file and generate jtl file and HTML report

del %JOB_BASE_NAME%.jtl #Delete the jtl file generated by each build

del %JOB_BASE_NAME%.log #Delete the log file generated by each build

rd /s /q %jmeter_home%\report #Delete the folder where the jmeter report is stored

md %jmeter_home%\report #Create a new folder for storing jmeter reports

jmeter -n -t E:\BaiduNetdiskDownload\wechat-maidian.jmx -l %WORKSPACE%\%JOB_BASE_NAME%.jtl -e -o %jmeter_home%\report #execute jmeter file and generate jtl file and HTML report

jmeter -n -t 'jmeter file path to be executed' -l 'generated jtl file storage path' -e -o 'generated jmeter test report storage path'

PS: Pay attention! The content written above is for reference only, and the specific content is written according to the actual situation

4. Operation after construction: Select Publish Performance test result report (if you do not have this option, you need to install the performance plug-in first)

5. Mailbox configuration: select post-build operation -> Editable Email Notification

6. Set the trigger mechanism for sending emails, here I choose Always; send emails regardless of the build result

7. After a series of configurations are completed, save the build.

8. The result of using Publish Performance test result report is that there will be an extra performance on the right side

Trend (I don't know what's wrong with the problem of Chinese garbled characters in the form, I haven't studied it yet)

 

PS: The Publish Performance test result report component is actually not necessary during the experiment. I saw other people’s articles on the Internet saying that this is done when I was studying, so I did it too. In fact, I also need a plug-in Publish HTML to cooperate with Publish Performance test result report is used; but I will report an error when downloading and installing, and it has not been resolved yet.

Second, the configuration of Jmeter

1. Prepare a jmx test file.

2. It is not necessary to open the jmeter client. Using jenkins to execute scripts requires jmeter to execute jmeter scripts in non-GUI mode.

3. The specific configuration of the mailbox

The specific configuration of the mailbox is detailed in another article of mine.

Fourth, the configuration of jmeter to generate HTML reports

The specific configuration of Jmeter to generate HTML reports is detailed in my other article.

Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, you can take it away if you need it:

insert image description here

Software testing interview applet

The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can use your mobile phone to do the quizzes, on the subway or on the bus, roll it up!

The following interview question sections are covered:

1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux

6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics

These materials should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey. I hope it can help you too! 

Guess you like

Origin blog.csdn.net/qq_48811377/article/details/132380296