I'm trying to set properties for a JMeter test using the Maven plugin. I've followed the recommended settings in my pom.xml
file from the answer to this question, but my properties aren't getting picked up when the tests are run.
The relevant parts of the pom.xml
:
<profiles>
<profile>
<id>jmeter-test</id>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.0.3</version>
<executions>
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<propertiesUser>
<threadCount>5</threadCount>
<environment>test</environment>
</propertiesUser>
<testResultsTimestamp>false</testResultsTimestamp>
<proxyConfig>
<host>localhost</host>
<port>8888</port>
</proxyConfig>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
I am trying to access the variables in my JMeter tests using: ${__P(threadCount)}
and ${__P(environment)}
.
When running, I'm using
mvn clean verify -Pjmeter-tests
I can see that the proxy configuration is being picked up and used from the output:
[INFO] -------------------------------------------------------
[INFO] P E R F O R M A N C E T E S T S
[INFO] -------------------------------------------------------
[INFO] Invalid value detected for <postTestPauseInSeconds>. Setting pause to 0...
[INFO]
[INFO] Proxy Details:
Host: localhost:8888
[INFO]
[INFO] Executing test: JMeterTests.jmx
Unfortunately the propertiesUser
values aren't getting used. I am also able to use the command line runner, which works as expected:
jmeter -n -t JMeterTests.jmx -Jenvironment=test -JthreadCount=5
Any ideas on why this isn't working?
More info:
I've been testing out using the example project, and see that the expected behaviour is that the configuration under <propertiesUser>
is supposed to populate the file target/jmeter/bin/user.properties
. This isn't happening, the file is not being created at all.