Open rogerxu opened 6 years ago
Apache JMeter - User's Manual: Functions and Variables
Apache JMeter - User's Manual: Elements of a Test Plan
${VARIABLE}
${__property(user.dir)}
- return value of user.dir${__property(user.dir,UDIR)}
- return value of user.dir
and save in UDIR
${__property(abcd,ABCD,atod)}
- return value of property abcd
(or "atod"
if not defined) and save in ABCD
${__property(abcd,,atod)}
- return value of property abcd
(or "atod"
if not defined) but don't save it${__P(group1.threads)}
- return the value of group1.threads
${__P(hostname,www.dummy.org)}
- return value of property hostname
or www.dummy.org
if not defined jmeter-maven-plugin/jmeter-maven-plugin: The JMeter Maven Plugin
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.7.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<generateReports>false</generateReports>
<resultsFileFormat>xml</resultsFileFormat>
<proxyConfig>
<host>proxy</host>
<port>8080</port>
<hostExclusions>localhost|*.example.com</hostExclusions>
</proxyConfig>
<propertiesUser>
<threads>${threads}</threads>
<loops>${loops}</loops>
<serviceHost>${serviceHost}</serviceHost>
</propertiesUser>
</configuration>
</plugin>
$ mvn clean verify -P PT-Test -Dthreads=3 -Dloops=10 -DservcieHost=www.host.com
Test Results File Format · jmeter-maven-plugin/jmeter-maven-plugin Wiki · GitHub
generateReports
: false
resultsFileFormat
: xml
protected void setJMeterResultFileFormat() {
if (generateReports || "csv".equalsIgnoreCase(resultsFileFormat)) {
propertiesJMeter.put("jmeter.save.saveservice.output_format", "csv");
resultsOutputIsCSVFormat = true;
} else {
propertiesJMeter.put("jmeter.save.saveservice.output_format", "xml");
resultsOutputIsCSVFormat = false;
}
}
Apache JMeter - Apache JMeter™