Friday, 15 June 2012

java - define a list in BeanShell (jmeter) -


Can anybody help in the Beanshell script? Therefore, I am trying to use a list in my code sample, however, I could not properly define the list such code from the Beanshell Post Proportional Sample:

  import Java.io. *; Import java.util. *; Import org.json *; Import org.apache.jmeter.samplers.SampleResult; If ((prev.getResponseCode ()! = Null) & amp; (prev.getResponseCode (.) Equals ("200") == true)) {JSONObject feedback = New JSONObject (prev.getResponseDataAsString ()); JSONArray array = response.getJSONArray ("user"); & Lt; String & gt; Users_list = new ArrayList & lt; String & gt; (); (Int i = 0; i & lt; arrays.lamban (); i ++) {JSONObject object = array.getJSONObject (i); Users_list.add (object.getString ("user_id")); Print (users_list); }} Jmeter.extractor.BeanShellPostProcessor: Problem in BeanShell script org.apache.jorphan.util.JmeterException: Error in starting bsh method: in eval file: inline evaluation: `` Import java.io. *; Import java.util. *; Import org.json *; Import org.apache.jmete. . Finally, in the form of '' expected '' = 10, column 31.  

In the list list = new ArrayList ();


No comments:

Post a Comment