jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Olson <galacto...@gmail.com>
Subject Sharing arrays between threads.
Date Fri, 10 Feb 2012 03:07:51 GMT
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

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