title: Jmeter : random number with beanshell
body: <p>I want to add 2 kind of parameters to a post request.</p>
  
  <p>From an http request I extract 2 list of variables: </p>
  
  <pre><code>Order_id = input type="hidden" name="(drag.+?)" value="(\d+?)"
  
  Weight_id = class="draggableviews-weight form-select" id=".+?" name="(drag.+?)"
  </code></pre>
  
  <p>In the Post Request that follows, I need to repost all this variables. I use a <code>BeanShell PreProcessor</code> for this. The first list is no problem, since this get the same value. The second list should get a new random value between -50 and 50. I also want a different random value for each iteration. </p>
  
  <p>How should I do this ?  </p>
  
  <p><img src="https://i.stack.imgur.com/TpJU9.png" alt="image1">
  <img src="https://i.stack.imgur.com/fQxUB.png" alt="image2">
  <img src="https://i.stack.imgur.com/iIqil.png" alt="image3"></p>
  
  <p>If I use Random Variabele Config Element I get the same random int for each variabele. I want a different one for each iteration. </p>
  
  <p><a href="https://i.stack.imgur.com/maQeP.png" rel="nofollow">enter image description here</a></p>