Jenkins integrated jmeter- interface automation
First of all, you need to confirm that in jmeter.properties, jmeter.save.saveservice.output_format=xml
Install xsltproc: download xsltproc.zip and extract it to a non-Chinese directory
-xsltproc is a fast XSLT engine that converts XML to HTML, PDF and other formats through XSL cascading style sheets
New
Free style
Timing construction
Construction
Execute windows batch commands, execute jmeter scripts, and convert xml results to html
If exist "JOB_BASE_NAME%.jtl" (del "JOB_BASE_NAME%.jtl")
If exist "total.html" (del "total.html")
If exist "detail.html" (del "detail.html")
Set jmeter_home=D:\ apache-jmeter-4.0
Set script_home=D:\ apache-jmeter-4.0\ bin
Jmeter-n-t% script_home%\% JOB_BASE_NAME%.jmx-l% JOB_BASE_NAME%.jtl
Set xsltproc=D:\ lr\ jmeter\ xsltproc\ bin\ xsltproc
% xsltproc%% jmeter_home%\ extras\ jmeter-results-detail-report_21.xsl% WORKSPACE%\% JOB_BASE_NAME%.jtl > total.html
% xsltproc%% jmeter_home%\ extras\ jmeter.results.shanhe.me.xsl% WORKSPACE%\% JOB_BASE_NAME%.jtl > detail.html
8. Operation after building-> Publish HTML reports, enter the path and name of the result file, and you can also add the result email notification, etc.
9. Build, view report
Note:
Note 2:
The report generated above is ugly and needs to be run:
System.setProperty ("hudson.model.DirectoryBrowserSupport.CSP", "")
Rebuilt, the report will look much better.
Remark 3:
If you restart jenkins, you need to rerun the above command
Since I learned python interface automation, I gave up jmeter, feeling that the code implementation is more flexible, and jmeter is more stupid when there are more interfaces.