Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Practice of ant+jmeter+Jenkins Interface Automation Test (1)

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

The project needs to do interface automation testing, so we go to do experiments, and do experiments from the beginning of building a test environment. In the process of learning will certainly encounter different problems, so it took two days to do a simple interface automation environment, in the middle also encountered some problems, now step on the road pit record.

1, ant environment construction

Download ant package and configure environment variables.

See my other blog for the configuration method. The address is as follows:

http://fangwei009.blog.51cto.com/5234706/1910384

2. jmeter environment construction

Download jmeter, see another blog, the address is as follows:

http://fangwei009.blog.51cto.com/5234706/1910385

Special note, I encountered errors when using jmeter 3.0, check the information that uses apache-jmeter-2.13, so we use jmeter version 2.13. Install it the same way as above, using version 2.13.

3, install JDK, configure java environment variables (skipped)

Jmeter+ant

a, First we default Jmeter script has been recorded, and test passed, there is (query module.jmx) script

b. Copy 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 the class "org.programmerplanet.ant.taskdefs.jmeter.JMeterTask" when running, thus successfully triggering the JMeter script.

c,jmeter saves files in.csv format by default, so we need to set the contents of the bin/jmeter.properties file first and save it.

jmeter.save.saveservice.output_format=xml

d. Main logical idea: Run the.jmx script below D:\jemeterTest\script to generate a.jtl file and put it in

In D:\jemeterTest\resultLog\jtl file, ant converts the corresponding file into the corresponding html file and puts it in D:\jemeterTest\resultLog\html.

The build.xml file contains the following:

Look at my directory environment:

Results after implementation:

Open html below html as shown below:

This is just the beginning. We still have to build Jenkins later. Optimize the script. To be continued.

If you have any questions, please pay attention to Weixin Official Accounts consultation!

For more automation tutorial resources, please pay attention to Weixin Official Accounts:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report