Eric,

Write a customized function to JMeter and manipulate a map of values inside
it.
Store it in JMeter properties scope.

Regards.
Flavio Cysne

2012/2/10 Eric Olson <[email protected]>

> Thanks for the swift reply, Deepak.
>
> I had a similar thought about the CSV thing, but I'm still running into the
> issue of not being able to store the tokens long enough to even put them in
> a CSV.  I hadn't considered serializing the array into a string - that may
> work for me as well.
>
> As for the CSV thing, how would I store the values long enough to get them
> into a CSV in the first place?  It seems like solving that problem is the
> same as solving my first problem, which is that I can't write multiple
> values to the same shared place.  Is there some sort of streaming CSV
> writer that can append the values as I go?  I think I may just be having a
> hard time grasping the scopes here.
>
> -Eric
>
> On Thu, Feb 9, 2012 at 7:13 PM, Deepak Shetty <[email protected]> wrote:
>
> > Hi
> > variables are scoped to the thread.
> > a. Use properties (but you'd have to represent the array as a delimited
> > string (also described in same link s step c)
> > b. Do you need randomness (or will sequential work) - if sequential works
> > then in a setup threadgroup write these values to a CSV , which is then
> > picked up by the next thread group using CSV data set config
> > c. use BSH shared namespace --
> > http://jmeter.apache.org/usermanual/best-practices - sharing variables
> >
> > regards
> > deepak
> >
> > On Thu, Feb 9, 2012 at 7:07 PM, Eric Olson <[email protected]> wrote:
> >
> > > Hi,
> > >
> > > I'm having a terrible time figuring out how to share an array of
> strings
> > > between different parts of my test plan.  The problem I'm trying to
> solve
> > > is that i want to "log in" all of my users up front to get a big list
> of
> > > tokens (using OAuth 2.0), and then when I move on to the actual load
> > > testing section of my test plan, I can just have it randomly pick a
> token
> > > from my array.
> > >
> > > The way I've been trying to do it is:
> > >
> > > -Define an array using a BSF preprocessor (via javascript) and add it
> to
> > > vars (vars.putObject("myArray",
> > > myArray);)
> > > -In the auth thread group, parse the response using regular expressions
> > > putting it into a temporary variable
> > > -In the auth thread group, use a BSF postprocessor retrieve my
> previously
> > > created array and add the temporary variable from the step above to the
> > > array, and put it back in vars
> > > -In my test thread group, which does not start running until my auth
> step
> > > is completed, each thread randomly picks from the array defined at the
> > test
> > > plan level.
> > >
> > > The problem I'm running into seems to be that there is some sort of
> scope
> > > issue where the data added during the auth step is not available to the
> > > test step - only what was predefined in the top-level preprocessor.
>  Am I
> > > doing this completely wrong, or what?  Can Arrays not be shared?  If
> so,
> > > how do you use data gathered from one step in the next step?
> > >
> > > Thanks,
> > >
> > > Eric
> > >
> >
>

Reply via email to