jmeter-maven-plugin

工程目录:


Maven pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>shanghai</groupId>
    <artifactId>jmeter</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>2.6.0</version>
                <executions>
                    <execution>
                        <id>jmeter-tests</id>
                        <goals>
                            <goal>jmeter</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <ignoreResultFailures>true</ignoreResultFailures>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

在src/test下新建文件夹jmeter,

把51Testing.jmx测试脚本复制到该文件夹,

再把jmeter.properties、saveservice.properties、system.properties、upgrade.properties、user.properties

也复制到该文件夹,

执行命令:mvn verify


查看测试报告:


猜你喜欢

转载自blog.csdn.net/yjlch1016/article/details/78767666