Skip to content

Modifying Properties

Ardesco edited this page Mar 12, 2013 · 19 revisions

Modifying Properties


##Adding Additional Properties To <propertiesJMeter>

It is possible to set properties that configure the main JMeter library. To set those properties you will need to specify each property in your pom.xml in the config element <propertiesJmeter> (The example below shows a property called log_level.jmeter being set). Each property specified is merged into the JMeter properties file jmeter.properties, it will overwrite any identical properties within the file.

+---+
<project>
	[...]
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>${project.groupId}</groupId>
					<artifactId>${project.artifactId}</artifactId>
					<version>${project.version}</version>
					<executions>
						<execution>
							<id>jmeter-tests</id>
							<phase>verify</phase>
							<goals>
								<goal>jmeter</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<propertiesJmeter>
							<log_level.jmeter>DEBUG</log_level.jmeter>
						</propertiesJmeter>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	[...]
</project>
+---+
Adding Additional Properties To <propertiesSaveService>

It is possible to set properties that configure the Saveservice of the main JMeter library. To set those properties you will need to specify each property in your pom.xml in the config element <propertiesSaveservice> (The example below shows a property called HTTPSampler2 being set). Each property specified is merged into the JMeter properties file saveservice.properties, it will overwrite any identical properties within the file.

+---+
<project>
	[...]
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>${project.groupId}</groupId>
					<artifactId>${project.artifactId}</artifactId>
					<version>${project.version}</version>
					<executions>
						<execution>
							<id>jmeter-tests</id>
							<phase>verify</phase>
							<goals>
								<goal>jmeter</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<propertiesSaveService>
							<HTTPSampler2>org.apache.jmeter.protocol.http.sampler.HTTPSampler2</HTTPSampler2>
						</propertiesSaveService>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	[...]
</project>
+---+
##Adding Additional Properties To <propertiesUpgrade>

It is possible to set properties that are used in the oldValue to newValue upgrade mapping of the main JMeter library. To set those properties you will need to specify each property in your pom.xml in the config element <propertiesUpgrade>. (The example below shows a property called my.old.ClassName being set). Each property specified is merged into the JMeter properties file upgrade.properties, it will overwrite any identical properties within the file.

+---+
<project>
	[...]
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>${project.groupId}</groupId>
					<artifactId>${project.artifactId}</artifactId>
					<version>${project.version}</version>
					<executions>
						<execution>
							<id>jmeter-tests</id>
							<phase>verify</phase>
							<goals>
								<goal>jmeter</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<propertiesUpgrade>
							<my.old.ClassName>my.new.ClassName</my.old.ClassName>
						</propertiesUpgrade>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	[...]
</project>
+---+
##Adding Additional Properties To <propertiesUser>

JMeter user properties are properties supplied to JMeter that can be used in JMeter tests. To set user properties you will need to specify each property in your pom.xml in the config element <propertiesUser> (The example below shows a property called threads and a propery called testIterations being set). Each property specified is merged into the JMeter properties file user.properties, it will overwrite any identical properties within the file.

+---+
<project>
	[...]
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>${project.groupId}</groupId>
					<artifactId>${project.artifactId}</artifactId>
					<version>${project.version}</version>
					<executions>
						<execution>
							<id>jmeter-tests</id>
							<phase>verify</phase>
							<goals>
								<goal>jmeter</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<propertiesUser>
							<threads>10</threads>
							<testIterations>5</testIterations>
						</propertiesUser>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	[...]
</project>
+---+
##Adding Additional Properties To <propertiesGlobal>

Global properties are properties that are sent to the remote machines. To set those properties you will need to specify each property in your pom.xml in the config element <propertiesGlobal> (The example below shows a property called threads and a property called testIterations being set). Each property specified is merged into the JMeter properties file global.properties, it will overwrite any identical properties within the file.

+---+
<project>
	[...]
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>${project.groupId}</groupId>
					<artifactId>${project.artifactId}</artifactId>
					<version>${project.version}</version>
					<executions>
						<execution>
							<id>jmeter-tests</id>
							<phase>verify</phase>
							<goals>
								<goal>jmeter</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<propertiesGlobal>
							<threads>10</threads>
							<testIterations>5</testIterations>
						</propertiesGlobal>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	[...]
</project>
+---+