gpt4 book ai didi

maven - 如何单独使用 GUI 在 Jmeter 中生成 HTML 文件?

转载 作者:行者123 更新时间:2023-12-03 18:09:50 24 4
gpt4 key购买 nike

我想使用 GUI 步骤为 Jmeter 测试生成 HTML 输出。

jmeter -n -t sometest.jmx -l abc.csv -e -o outputhtml

我想包括生成 html 输出的步骤,就像 GUI 中的简单 Simple Data Writer 监听器一样。

我正在使用 jmeter 的 maven 插件,我无法在其中指定 html 输出。如果我可以将该步骤放入测试中,那么它就可以轻松实现自动化。

最佳答案

从 2.2.0 版本开始,内置了 html 生成:

只需在 configuration 元素中添加:

 <generateReports>true</generateReports>

这是一个 pom 的例子:

 <?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.ubikloadpack.jmeter</groupId>
<artifactId>maven-generate-reports</artifactId>
<version>1.0.0</version>
<description>Check that report generation works</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.2.0</version>
<configuration>
<suppressJMeterOutput>false</suppressJMeterOutput>
<testFilesIncluded>
<testFilesIncluded>**/*.jmx</testFilesIncluded>
</testFilesIncluded>
<generateReports>true</generateReports>
</configuration>
<executions>
<execution>
<id>configure</id>
<goals>
<goal>configure</goal>
</goals>
</execution>
<execution>
<id>performance test</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>results</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

关于maven - 如何单独使用 GUI 在 Jmeter 中生成 HTML 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44201784/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com