Just read this article to implement continuous integration with Jmeter+ant+jenkins!

jmeter+ant+jenkins continuous integration

1. Download and configure jmeter

First download the jmeter tool and configure the environment variables; reference: https://www.cnblogs.com/YouJeffrey/p/16029894.html

  By default, jmeter saves files in .jtl format. You need to set bin/jmeter.properties, file content, and save jmeter.save.saveservice.output_format=xml. 

 2. Download and configure the ant tool

Download the ant tool and configure the environment variables; reference: https://www.cnblogs.com/YouJeffrey/p/16176224.html

Ant tool network disk address:

Link: https://pan.baidu.com/s/1o4hzidZF2hk3T3SdDkMOwQ 
Extraction code: bt9j


3. Trigger the configuration of jmeter script through ant

Copy the ant-JMeter-1.1.1.jar in the extras subdirectory of the directory where JMeter is located to the lib subdirectory of the directory where Ant is located, so that Ant can find "org.programmerplanet.ant.taskdefs.jmeter.JMeterTask" when running. This class thus successfully triggers the JMeter script.

Under the extras folder in jmeter; as shown below:

 Under the lib file of the ant tool package

4. Jar package configuration for automatically sending emails; as shown below:

1. Download the commons-email.jar package from the website, and then place it in the \lib directory of ant; https:// commons.apache.org/proper/commons-email/download_email.cgi

2. Download the activation-1.1.1.jar package from the website, and then place it in the \lib directory of ant; http: //www.java2s.com/Code/Jar/a/Downloadactivation111jar.htm

3. Download the javax.mail.jar package from the website, and then place it in the \lib directory of ant; https:// javaee.github.io/javamail/

Or get the above three jar packages directly from the network disk

Link: https://pan.baidu.com/s/1EGl9a6477ABBIRtqj8vA-A 
Extraction code: 3uc7 
 

 

5. Create the following directory structure

 

1. resultlog
html =>ant converted result.
jtl=>Result generated by imeter
2, script
Script executed by jmeter

3. Configure the build.xml file:

build.xml file network disk address:

Link: https://pan.baidu.com/s/1-Q6-JUsXFzIXbibntdUZRg 
Extraction code: k2vs

The build.xml file should be placed in the directory of the pc or app; as shown below:

 Configure details of the build.xml file content

 

 Key points: smtp authorization code; such as QQ mailbox

 

After the configuration is completed, open the DOS window to the directory where the build.xml file is located, enter ant to generate a report and send it to the designated person's mailbox; the result is as shown below

 

6. Build through jenkins and automatically run jmeter scripts

1. Create a new item task; as shown below

2. Build a trigger and set how often it is triggered.

Clocked tasks:
Minutes Hours Days in January Months Days in a week
0-59 0-23 1-31 1-12 0- 7 (0 and 7 represent days of the week)
Example:
Automatically executed at 20 o'clock every night
0 20 * * *
Execute at 20:00 on 1, 3, 5 every week
0 20 * * 1,3,5
Every week 1-Friday, it will be executed at 20:00 pm
0 20 * * 1-5
Every 2 days in a week, it will be executed at 20:00 pm< a i=11>0 20 * * */2

3. Jump to the build step interface, click Add Build Step and select Invoke Ant.

 Then click the Advanced button

Copy the path of the build.xml file to the location shown below

 Click Save to return to the main page; Click Build Now to start execution

 4. Execution results, check the recipient’s email address

 

 Recommended tutorials related to automated testing:

The latest automated testing self-study tutorial in 2023 is the most detailed tutorial for newbies to get started in 26 days. Currently, more than 300 people have joined major companies by studying this tutorial! ! _bilibili_bilibili

2023 latest collection of Python automated test development framework [full stack/practical/tutorial] collection essence, annual salary after learning 40W+_bilibili_bilibili

Recommended tutorials related to test development

The best in the entire network in 2023, the Byte test and development boss will give you on-site teaching and teach you to become a test and development engineer with an annual salary of one million from scratch_bilibili_bilibili

postman/jmeter/fiddler test tool tutorial recommendation

The most detailed collection of practical tutorials on JMeter interface testing/interface automated testing projects. A set of tutorials for learning jmeter interface testing is enough! ! _bilibili_bilibili

To teach yourself how to capture packets with fiddler in 2023, please be sure to watch the most detailed video tutorial on the Internet [How to Learn to Capture Packets with Fiddler in 1 Day]! ! _bilibili_bilibili

In 2023, the whole network will be honored. The most detailed practical teaching of Postman interface testing at Station B can be learned by novices_bilibili_bilibili

  Summarize:

 Optical theory is useless. You must learn to follow along and practice it in order to apply what you have learned to practice. At this time, you can learn from some practical cases.

If it is helpful to you, please like and save it to give the author an encouragement. It also makes it easier for you to search quickly next time.

If you don’t understand, please consult the small card below. The blogger also hopes to learn and improve with like-minded testers.

At the appropriate age, choose the appropriate position and try to give full play to your own advantages.

My path to automated test development is inseparable from plans at each stage, because I like planning and summarizing.

Test development video tutorials and study notes collection portal! !

 

Guess you like

Origin blog.csdn.net/m0_59868866/article/details/134721486