Hello all,

In my test I have 5 thread groups - I was wondering if it is possible to share 
common logic between the thread groups.

Basically all of my tests have user id and organization id in the headers.
For each thread that is running I am randomly selecting a user id in the range 
of 1-50 and organization id in the range of 1-100.

All this is achieved by using a Bean Shell Preprocessor that is attached to 
each of the samplers.

For each of the samplers this random editing of the header might also be 
accompanied by some editing of the url as a result of the random user ID.

By attaching a preprocessor to each sample I manage to do all this - but I was 
wondering if there is some way to define some utility methods that I can call 
from each Bean Shell processor and avoid repeating the logic.

For example:
...
HeaderManager hm = sampler.getHeaderManager();
callMySetHeaders(hm);
// Do some specific code

I know that it is possible to have custom functions - but my understanding is 
that they only return a string - I am asking if there is a way to write more 
complex code.

Thanks,
Noa Drach

Reply via email to