I have a test plan which uses connectHostname to send the requests.
Current pom looks like below
<properties>
<performancetest.connectHostname>some_default_hostname</performancetest.connectHostname>
</properties>
<profiles>
<profile>
<id>jenkins</id>
<properties>
<performancetest.connectHostname>hostname_for_jenkins_profile</performancetest.connectHostname>
</properties>
</profile>
</profiles>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.0</version>
<configuration>
<testResultsTimestamp>false</testResultsTimestamp>
<overrideRootLogLevel>DEBUG</overrideRootLogLevel>
<suppressJMeterOutput>false</suppressJMeterOutput>
<ignoreResultFailures>true</ignoreResultFailures>
<propertiesJMeter>
<jmeter.save.saveservice.thread_counts>true</jmeter.save.saveservice.thread_counts>
</propertiesJMeter>
<jmeterPlugins>
<plugin>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins</artifactId>
</plugin>
</jmeterPlugins>
</configuration>
<executions>
<execution>
<id>execute-jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
<phase>integration-test</phase>
</execution>
</executions>
</plugin>
I want to pass the hostname from command line e.g.
Test plan (jmx file) looks like below
<elementProp name="connectHostname" elementType="Argument">
<stringProp name="Argument.name">connectHostname</stringProp>
<stringProp name="Argument.value">${__P(performancetest.connectHostname}</stringProp>
<stringProp name="Argument.desc">Entrypoint host</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
- If I hardcode the hostname the tests are working fine but when I try to use the command line variable like above, it is not able to execute.
I want to know how to achieve this. Appreciate any help!!