title: Parameterize JMeter HTTP request path
body: <p>I'm creating JMeter tests for a service which context root may change depending on the host/environment. I'm trying to map the context root within the HTTP request path as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/45FDi.png" rel="nofollow noreferrer">Http request path</a></p>
  
  <p>I've created a user defined variable as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/RJPSY.png" rel="nofollow noreferrer">contextRoot user variable definition</a></p>
  
  <p>I'm running my tests using <a href="https://github.com/jmeter-gradle-plugin/jmeter-gradle-plugin" rel="nofollow noreferrer">jmeter-gradle-plugin</a> and that's how I'm passing the context root as a command line parameter:</p>
  
  <pre><code>-PcontextRoot=/my-context-root
  </code></pre>
  
  <p>But I'm always getting 404 responses because JMeter is not replacing the variable with the parameter value as expected.</p>
  
  <p>Any clue about what I'm doing wrong? Thanks in advance.</p>