Performance test Jmeter+Ant +Jenkins framework (local)

Foreword:

 

The previous performance tests were done directly using the jmeter tool. All scripts and reports are on this tool. Later, other tools will be gradually applied to cooperate with jmeter in order to better implement performance tests and output performance test reports.

 The Jmeter+Ant+Jenkins framework can realize batch processing scripts, output more beautiful test reports, execute scripts regularly, and interview materials

 Tool preparation

1. Tool example diagram

Implementation process

1. Locally prepared environment

 1.1 Download JDK, Jmeter, Tomcat, Jenkins, Ant   locally. There are many tutorials on the Internet. I won’t explain them in detail.

Among them, JDK, Jmeter, and Ant all need to configure environment variables

tomcat and jenkins do not need

2. Use jmeter to write performance scripts, the first step

 2.1 It is best to write two performance scripts, so as to reflect the function of Ant's batch processing jemter script;

2.2 Put the written script under the jmeter file

Script example:

3. Configure Ant batch data in the jemter file Step 2

 3.1 Open the jemeter installation package, find the build.xml file under the extras file, and open it through notepad++

Configuration Ant operations are basically edited in this build.xml file, such as batch files, the location of the processed files, whether to clear the result files of the last operation after running again, etc.;

 

3.2 Start configuring the buil.xml file 

 3.2.1 Simple command introduction, such as running test files, outputting test reports,

3.2.2 Modification 1: Modify the path of the read file in the configuration file, the path of the test script file, and the name of the test report

Remarks: After the modification, I directly cut the testpath line and modified his path

If you only want to run a single performance script, see the figure below.

3.2.3 Select whether to record the report records of failed operations 

3.2.4 Delete the jtl file, the record of the last execution before each run

3.2.5 Delete the note to make it work, why did you forget

3.2.5 The data configuration of ant is finished here, and the execution can be started below

 3.2.5.1 Implementation method 1:

In dos, switch to the extras path of jmeter and enter: ant

 After running successfully, an html report will be generated in our stored script file

view results report

 

 It has basically been realized here, and the final timing start of jenkins is still missing

 4. Jenkins scheduled task start

  Locally, jenkins needs to depend on tomcat, so tomcat needs to be installed and opened successfully;

Then we need to put the jenkins.war package under the tomcat package wbapps

4.1 Web page startup view

  Input address: http:ip:8080/jenkins If the login interface/password interface appears, it means success

Displayed as follows: 

 

Jenkins timing startup implementation process creates a new item—— 

Guess you like

Origin blog.csdn.net/weixin_55944621/article/details/126975595