title: Jmeter Beanshell: Take multiple variables from CSV Data Set Config?
body: <p>I have a Jmeter test in which I want to post an XML message to a JMS queue. This message will be formed dynamically via a BeanShell Preprocessor, which pulls data from multiple CSV Data Set Config elements. </p>
  
  <p>One item of this XML message that is dynamic is the number of  elements in it - it will be a random number between 1 and 10. For each Line element, I want to pull a different variable from a CSV Data Set Config element. However, I'm finding if I do something like the below, I keep getting the same variable:</p>
  
  <pre><code>for (int i = 0; i &lt; numberOfLines; i++) {
    InputXML = InputXML + "&lt;OrderLine ItemID=\"${ItemID}\" /&gt;";
  }
  </code></pre>
  
  <p>The above will keep using the same ${ItemID} variable for all of lines but what I want is for it to grab the next one in the CSV file.</p>
  
  <p>Is there any way to accomplish this via Beanshell?</p>