title: Jmeter beanshell Sampler_ Getting Error invoking bsh method
body: <p>can we use vars.put to add the members of array list?</p>
  
  <p>Below is my code which is throwing exception at at line 10, column 25 
  and error is:</p>
  
  <blockquote>
    <p>Error invoking bsh method: eval   In file: inline evaluation of:
    ``import java.util.List; import java.util.ArrayList; public static
    void main(Strin . . . '' Encountered "vars" at line 10, column 25.</p>
  </blockquote>
  
  <pre><code>import java.util.List;
  import java.util.ArrayList;
  public static void main(String[] ard)
  {
      String OperationNme = ${op};
      String[] serviceTypeVal = {12,19,20,21,22,23,26,27,28,31,32,11};
      String serviceType;
      switch (OperationNme) {
              case 1:  OperationNme.contains("sdv")
                       vars.put("serviceType",serviceTypeVal[0]);
                       break;
              case 2:  OperationNme.contains("doorUnlock")
                       vars.put("serviceType",serviceTypeVal[1]);
                       break;
              case 3:  OperationNme.contains("doorLock")
                       vars.put("serviceType",serviceTypeVal[2]);
                       break;
              case 4:  OperationNme.contains("hornLights")
                      vars.put("serviceType",serviceTypeVal[3]);
                       break;
              case 5:  OperationNme.contains("engineOn")
                       vars.put("serviceType",serviceTypeVal[4]);
                       break;
              case 6:  OperationNme.contains("engineOff")
                       vars.put("serviceType",serviceTypeVal[5]);
                       break;
              case 7:  OperationNme.contains("dtc")
                       vars.put("serviceType",serviceTypeVal[6]);
                       break;
              case 8:  OperationNme.contains("vrc")
                       vars.put("serviceType",serviceTypeVal[7]);
                       break;
              case 9:  OperationNme.contains("vhc")
                       vars.put("serviceType",serviceTypeVal[8]);
                       break;
              case 10: OperationNme.contains("chgPrf")
                       vars.put("serviceType",serviceTypeVal[9]);
                       break;
              case 11: OperationNme.contains("evNotif")
                       vars.put("serviceType",serviceTypeVal[10]);
                       break;
              case 12: OperationNme.contains("vehStatus")
                       vars.put("serviceType",serviceTypeVal[11]);
                       break;
              default: OperationNme.contains("Invalid Operation Name")
                       break;
          }
  
  
  
  }
  </code></pre>