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

标签 maven jmeter

我想使用 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/

相关文章:

jmeter - 找不到适用于 jdbc :mysql://localhost:3306/Testing in JMETER JDBC connection configuration 的合适驱动程序

mysql - MYSQL 的 JDBC 连接配置在 Jmeter 中不起作用

java - 创建名为“defaultServletHandlerMapping”的 bean 时出错

maven - 错误 : Unable to locate tools. jar 。预计在/usr/lib/jvm/java-6-sun-1.6.0.26/lib/tools.jar中找到

jmeter - 如何在超高分辨率显示器上使用Jmeter UI

jmeter - JVM 应该已经退出但没有

gradle - 执行gradle jmeter集成时出现Jcharts错误

java - 使用 mvn -v 不支持major.minor版本51.0

java - import org.apache.poi.xssf 无法解析

android - 如何 Maven-ise 一个 ActionBarSherlock 项目?