jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Write and Read javascript arrays in BSF Processors
Date Mon, 21 Mar 2011 19:56:09 GMT
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
View raw message