我在 Jmeter 上构建了一个测试计划并从 maven 运行它。但是当我在 Jmeter 中指定的 Maven 上运行测试时,我不知道如何从命令行获取这些用户定义的变量。例如,我已经使用“${__P(users)}”定义了 jmeter 中的线程数字段,或者我有一些 if 控制器条件来运行特定线程。并用 "${__P(tiff)}" == "true" 指定 if 控制器的 if 条件。
所以
我在pom.xml中的依赖和插件如下:
<dependencies>
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>jmeter</artifactId>
<version>0.3.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud) 我试图在jmeter中构建一个测试计划,我想根据它们的名称运行特定HTTP请求的测试.我使用if控制器,但我不知道写什么条件.
我正在写${__samplerName()}=="HTTPRequestName"条件,但它没有执行.请尽快帮助我.