General idea:
jmeter completes the interface script, Ant completes the script execution and collects the results to generate a report, and finally uses jenkins to complete the automatic integrated operation of the script.
Environment installation :
1, jdk installation and configuration environment variables
2, decompress the zip package of jmeter to the local, decompress the zip package of ant to the local
3, Ant configuration environment variables
Right-click on the computer-Properties-Advanced System Settings-Advanced-Environment Variables-System Variables
ANT_HOME: ant decompression path
Path:%ANT_HOME%\bin
CALSSPATH:%ANT_HOME%lib;
4, cmd to verify whether Ant is installed successfully
5. Place JMeter Copy the ant-JMeter-1.1.1.jar in the extras subdirectory of the directory to the lib subdirectory of the Ant directory
6. The report template xls file is placed in the extras folder of the jmeter directory [Jmeter comes with it Several sets of templates are available for everyone to use, in the extras subdirectory of the Jmeter installation directory, the suffix is xsl]
7. Create the following test script directory structure
jmeter_test (main directory file)< br /> result (test report and log directory)
--html (test report directory)
-jtl (store jtl file directory)
script (store jmeter jmx script file)< br /> build.xml (core configuration file)
8. Build.xml core configuration file, the code is as follows
------------ -------------------------------------------------- --------------------------
< /h2>
What needs to be modified in build.xml
Run under 10.cmd directory and switch to jmeter_test directory, enter ant to execute, wait for time, BUILD SUCCESSFUL
11. View report
12. General steps to integrate into Jenkins
12.1 System Management-Global Tool Configuration, configure jdk and ant
< br>12.3 Project Construction
12.3.1 Create a new free style construction task. In the running Jenkins homepage, click New Job on the left to enter the following interface
12.3.2 Add build step, ant execute command
Ant Version Choose the name of your Ant configuration, and be careful not to choose default
12.3.4 Run OK