【发布时间】:2017-06-07 19:28:01
【问题描述】:
我创建了一个简单的 JMETER 负载测试,它在 JMETER 上运行得非常好。我通过以下方式创建了负载测试用例:
- 在 Eclipse 中编写一个简单的 JUNIT 测试
- 将 JUNIT 测试导出为 Jar
- 使用 JUNIT 测试用例创建负载测试。
以上在 JMETER 中运行良好。但是,我无法使用 MAVEN(JMETER MAVEN 插件)运行相同的程序,即测试无法运行。我可以看到一条消息
[info] Executing test: JUnitRequest.jmx
[info] Completed Test: JUnitRequest.jmx
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.033s
[INFO] Finished at: Wed Jun 07 20:12:40 BST 2017
[INFO] Final Memory: 16M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:1.9.1:jmeter (jmeter-tests) on project restapitest: C:\2017\JMETER\RestApiTest\target\jmeter\results\20170607-JUnitRequest.jtl (The system cannot find the file specified) -> [Help 1]
[ERROR]
然后是错误信息:
请在下面找到我的 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>com.jmeter.restapi</groupId>
<artifactId>restapitest</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins:pom:1.3.1</artifact>
</jmeterExtensions>
<junitLibraries>
<artifact>com.lazerycode.junit:junit-test:1.0.0</artifact>
</junitLibraries>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.17</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
【问题讨论】:
标签: jmeter