jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Drach, Noa" <>
Subject Sharing logic between thread groups
Date Thu, 13 Jun 2013 12:54:47 GMT
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();
// 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.

Noa Drach

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