jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kai Kaisen <kaikai...@googlemail.com>
Subject Re: Write and Read javascript arrays in BSF Processors
Date Tue, 22 Mar 2011 10:24:53 GMT
Oh yes, javadoc helped a lot here. Thank you!
Kai

On Mon, Mar 21, 2011 at 8:56 PM, sebb <sebbaz@gmail.com> wrote:

> On 21 March 2011 18:57, Kai Kaisen <kaikaisen@googlemail.com> wrote:
> > Hi guys,
> > I have a questions regarding javascript arrays. Can they be stored as
> > 'global variables' in jmeter?
> >
> > I have a BSF PostProcessor parsing a JSON response and storing data in an
> > javascript array:
> >  var prodArray= new Array();
> >  ...
> >  prodArray.push(prodWorkspaceName);
> >  ...
> >
> > This array gets put to jmeter variables:
> >  vars.put("prodArray", prodArray);
>
> If you have a look at the Javadoc, you will see that method takes two
> Strings.
>
> You want putObject().
>
> >
> > Now, in another BSF PreProcessor I want to access this array, but I do
> not
> > succeed in get the data as an array. I tried several things, also this:
> >  var prodArray = new Array(vars.get("prodArray"));
> >
> > But what I get is an array with the whole comma separated content of the
> > original array as one string. Seems as if the array can only be stored as
> > string globally?
> >
> > Any idea?
> > Thanks!
> > Kai
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message