JMeter interface test automation for Web interface Testing (four) (continuous build)

Source: Internet
Author: User
Tags xsl

Reprint http://www.cnblogs.com/chengtch/p/6145867.html

JMeter is a stress test, interface test tool, Ant is a Java-based build tool that has a cross-platform role, and Jenkins is a continuous integration tool. Combine these three to build a set of WebService interface test continuous build environment.

1. Install JDK, configure Java environment variables (skip)

2, install JMeter, the version used here is 2.12 (theinstallation process skipped)

3. Install ANT

3.1 Download and install

HTTP://ANT.APACHE.ORG/BINDOWNLOAD.CGI, unzip to the specified location after downloading,

For example: D:/program files/apache-ant-1.9.0

3.2 Configuring environment variables

3.3 Installation Verification

Verify installation results, command line input ant-v, version information is installed successfully

4. Configuring JMeter in Ant

4.1. Configuration library file

Copy the Ant-jmeter-1.1.1.jar file under the JMeter Extras directory to the Lib folder in the Ant installation directory

Copy from:

Paste to:

4.2 Configuring the configuration file for Ant and JMeter

4.2.1 Configuring the ant compilation file Build.xml

Copy the following content into the new TXT file and rename the file to: Build.xml

View Code

Modify the Build.xml file as per the situation below

4.2.2 Configuration Jmeter.properties

Configure the JMeter report output format as XML in the JMeter root directory jmeter.properties file to modify Jmeter.save.saveservice.output_format=csv to

Jmeter.save.saveservice.output_format=xml, and remove the previous comment symbol #

4.3 verifying configurations, performing build tests

4.3.1 Preparing test Script data

The build configuration file is placed in the same directory as the test script

4.3.2 Performing Tests

Command line CD to the directory where the Build.xml file is located, enter Ant run, perform the test

Seeing build successful indicates successful build test

View test Results Report under 4.3.3 Report output path

Find the HTML test report by pressing the test report address set in the Build.xml file

Open look: Test results show the number of use cases, success rate, use case execution time and other results parameters

4.4. Test Report Optimization

The test report obtained from the JMeter test report is not very complete, here refer to the online method, do an optimization

4.4.1, download optimization template jmeter-results-shanhe-me.xsl, copy to JMeter Extras directory,

such as C:\apache-jmeter-2.12\extras

4.4.2, setting the test output report what to output

Also in Jmeter.properties, set the content that needs to be output to true, and remove the previous comment symbol #, all set to True

4.4.3 the report template for the Setup build file is the optimized template jmeter-results-shanhe-me.xsl

4.4.4, build the test again with ant in the previous way, and view the optimized test report

5. Configure Jenkins

5.1, Jinkins.war download and installation, download and put to the D packing directory

5.2, configure environment variables, set Jenkins_home

5.3. Unzip and start Jenkins

Command line Input Java-jar Jenkins.war, enter Url:jenkins host IP port in the browser: 8080, turn on Jenkins,

Configure the user name, password and plugin, where you need to configure the Invoke ant plugin, HTML test report display plug-in

5.4. Create and configure a job

Set the project name:

Configuration build:

Configuration build: Invoke Ant

To configure the build file path:

Configure the test report plug-in to open the test results report

Basic Configuration Complete

5.5. Job homepage, click Build Now, execute test, build complete to view test results by Html_report

Continue with the basic completion of the build, you can also configure the mail plug-in to send test reports, set the build time to automatically perform the test at timed

JMeter interface test automation for Web interface Testing (four) (continuous build)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.