我使用jmeter-maven-plugin (version 1.10.0)运行JMeter测试。我希望更改结果文件的默认名称,因此我希望更改option -l (logfile)的参数:
[debug] JMeter is called with the following command line arguments: -n
-t C:\XX\JMeter\src\test\jmeter\some-test.jmx
-l C:\XX\JMeter\target\jmeter\results\20150323-some-test.jtl
-d C:\XX\JMeter\target\jmeter
-j C:\XX\JMeter\target\jmeter\logs\some-test.jmx.log编辑:我使用: mvn集成-test-Prun-一些测试从IntelliJ运行它。
我定义了两个配置文件(用于两个不同的测试文件):
<profile>
<id>run-some-test</id>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<testFilesIncluded>
<jMeterTestFile>some-test.jmx</jMeterTestFile>
</testFilesIncluded>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>run-another-test</id>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<testFilesIncluded>
<jMeterTestFile>another-test.jmx</jMeterTestFile>
</testFilesIncluded>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>发布于 2015-03-24 18:03:17
你不能.
测试名称用于创建日志名称。因此,举个例子,如果您的测试名称是:
some-test.jmx
您的日志名将始终为:
some-test.log
不能更改日志名称的原因是,块中指定的每个名称实际上都在内部用作REGEX。正常的文件名(正如您前面所指定的)是一个有效的REGEX,这就是它工作的原因。
由于每个文件都是REGEX,我们不知道它将返回多少个文件,所以我们无法在一个文件和一个日志文件之间进行一对一的映射。
为了保持简单和防止问题,我们硬编码日志文件名,如上文所述。
https://stackoverflow.com/questions/29211904
复制相似问题