首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在jmeter plugin中更改结果文件名( jtl文件)?

如何在jmeter plugin中更改结果文件名( jtl文件)?
EN

Stack Overflow用户
提问于 2015-03-23 13:47:42
回答 1查看 1.5K关注 0票数 1

我使用jmeter-maven-plugin (version 1.10.0)运行JMeter测试。我希望更改结果文件的默认名称,因此我希望更改option -l (logfile)的参数:

代码语言:javascript
复制
    [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运行它。

我定义了两个配置文件(用于两个不同的测试文件):

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-03-24 18:03:17

你不能.

测试名称用于创建日志名称。因此,举个例子,如果您的测试名称是:

some-test.jmx

您的日志名将始终为:

some-test.log

不能更改日志名称的原因是,块中指定的每个名称实际上都在内部用作REGEX。正常的文件名(正如您前面所指定的)是一个有效的REGEX,这就是它工作的原因。

由于每个文件都是REGEX,我们不知道它将返回多少个文件,所以我们无法在一个文件和一个日志文件之间进行一对一的映射。

为了保持简单和防止问题,我们硬编码日志文件名,如上文所述。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29211904

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档