jmeter - How to run JSR223 PreProcessor only once -
i have test plan in jmeter requires parameters needs calculated before running test. in order calculate these parameters, created jsr223 preprocessor directly under test plan seen below.

my problem preprocessor seems run before every request not want. need calculate these parameters once , use them in testing.
is there way run jsr223 preprocessor once, or should use method?
thanks in advance.
edit:
as @ubik-load-pack suggested, tried "setup thread group" following variables created in code not available under "thread group". present neither in logs (logging used in code) nor in view results tree (via debug postprocessor)

i tried "once controller" didn't work, same above.

for more information here content of jsr223 preprocessor. (not whole code, there more variables here using date functions not solution me way.)

by design preprocessor runs before sampler runs.
so if want run once per user, can following:
- use once controller , put in jsr223 sampler contain code.
if want to once users, use setupthreadgroup contain jsr223 sampler , configure 1 thread. run once before regular thread groups started.
edit after updated question:
as wrote, cannot use setupthreadgroup approach if want reuse variables in thread groups stick onceonlycontroller approach request
with once controller not working because misread answer, suggesting use jsr223 sampler not preprocessor preprocessor run if there sampler runs.
Comments
Post a Comment