带有 IntelliJ 和 jmeter-maven-plugin 的 Apache JMeter

Apache JMeter with IntelliJ and jmeter-maven-plugin

我想 运行 使用 IntelliJ 和 Maven 的 jmeter 脚本。基本上我的目标是通过 Jenkins 运行 一个 jmeter 脚本。 我做了以下步骤:

  1. 下载了Jmeter源代码并解压了下的所有文件 C:\Jmeter\apache-jmeter-3.3
  2. 通过使用 jmeter.bat
  3. 启动 jmeter 创建了一个脚本
  4. 将脚本保存在 C:\Jmeter\apache-jmeter-3.3\bin\templates\create-client.jmx

  5. 在新文件夹 C:\Jmeter-test

  6. 下在 IntelliJ 中创建了一个新的 Maven 项目
  7. 已复制报告模板,reportgenerator.properties 在 src/test/resources
  8. src/test/jmeter/create-client.jmx[=11=下复制了create-client.jmx ]

  9. 已修改 pom.xml 以包含 Jmeter 插件

    <plugins>
        <plugin>
            <groupId>com.lazerycode.jmeter</groupId>
            <artifactId>jmeter-maven-plugin</artifactId>
            <version>1.6.1</version>
            <executions>
                <execution>
                    <id>jmeter-tests</id>
                    <goals>
                        <goal>jmeter</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <testFilesIncluded>
                    <jMeterTestFile>create-client.jmx</jMeterTestFile>
    
                </testFilesIncluded>
            </configuration>
        </plugin>
    

当我 运行 mvn verify 命令时,它说 'No Tests to Run'。我对 IntelliJ 和 Maven 不是很熟悉。不确定我是否需要导入现有的 Jmeter 源 code.Any 帮助会很感激。谢谢!

根据此文档:

使用版本2.7.0应该没问题:

     <plugin>
    <groupId>com.lazerycode.jmeter</groupId>
    <artifactId>jmeter-maven-plugin</artifactId>
    <version>2.7.0</version>
    <executions>
        <execution>
            <id>jmeter-tests</id>
            <goals>
                <goal>jmeter</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <testFilesIncluded>
            <jMeterTestFile>create-client.jmx</jMeterTestFile>

        </testFilesIncluded>
    </configuration>
</plugin>