We all need to do a headless test with JMeter at some point. JMeter maven plugin lets us easily integrate maven and Jmeter together. We can define properties/variables in jmeter script and override them in the maven plugin. But for god knows what reason passing parameters/properties as in the wiki page doesn’t work, some say its maven thing, I think its a problem in the plugin. Anyway don’t have time to figure it out, here is how I got around.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<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> <jMeterProcessJVMSettings> <arguments> <argument>-DnumberOfThreads=${numberOfThreads}</argument> </arguments> </jMeterProcessJVMSettings> </configuration> </execution> </executions> </plugin> |
1 2 3 4 5 6 7 8 9 10 11 |
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="Variables" enabled="true"> <collectionProp name="Arguments.arguments"> <elementProp name="threadcount" elementType="Argument"> <stringProp name="Argument.name">threadcount</stringProp> <stringProp name="Argument.value">${__P(numberOfThreads,1)}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> </Arguments> |