Introduced
When performing a performance test, the Jmeter Official document declaration is not recommended in the GUI, and the command line needs to be used at this time.
First Step: Environment configuration
Add the JMeter installation directory \ Bin to the system environment variable path
Step Two: Command parameters
-N command-line mode
-T Script path
-L test Result path (JTL or CSV)
-j Log Path
-R Distributed execution
-R remote Server list
-G Generate test Report
-e Setup test report is generated after testing is completed
-O Specify test report generation folder
-H Proxy Server IP
-P Proxy Server port
Examples are as follows:
Jmeter-n-T C:\apache-jmeter-5.0\My_Source\test02.jmx-l C:\apache-jmeter-5.0\My_Source\Result\testreport.jtl-e-o C : \apache-jmeter-5.0\my_source\report
Step three: Complete and batch execution
(1) Each time the above command is re-executed, it is necessary to manually clean up the report file, so it is better to automatically clean up, we just need to maintain the script on the line
(2) Create a new bat file
Write:
/s/q C:\apache-jmeter-5.0/s/q C:\apache-jmeter-5.0\my_source\report# Rebuild the test Report folder (modify the custom directory for new users) MD C:\apache-jmeter-5.0\my_source\report# perform the test (new user please modify custom directory) # need to put JMeter installation directory \ Bin added to system variable # command interpretation:-N for non-gui,-t specified script (script file name cannot contain Chinese characters),-l Specify run result file save path, e -set test report after completion,-o -n-t C:\apache-jmeter-5.0\my_source\test02.jmx-l C:\apache-jmeter-5.0\my_source\ RESULT\TESTREPORT.JTL-E-o C:\apache-jmeter-5.0\my_source\report
(3) At this point, complete
(4) Follow-up can be considered into Python, in order to more convenient and fast
Reference documents
https://testerhome.com/topics/12114
Jmeter non-GUI command line execution script file