Re: Session token generation in JMeter with Run Thread Groups Consecutively option ON
Abhitosh Patil <[email protected]> Sun, 8 Mar 2026 03:10:58 +0530
| Newsgroups | gmane.comp.jakarta.jmeter.user |
|---|---|
| Message-ID | <CAC-b7DRoCZLy-dbsdnK7=XASxk+41UoMikHSijZYFxDDkuALnw@mail.gmail.com> |
--0000000000001769aa064c7607f1 Content-Type: text/plain; charset="UTF-8" Thank Felix. I'll try this. On Sun, 8 Mar, 2026, 00:51 Felix Schumacher, < [email protected]> wrote: > Hi, > > JMeter doesn't provide that functionality out of the box. If you are able > to program you token refresh in groovy (or any other JSR223 Sampler), you > can take a look at the attached test plan. > > That test plan creates a daemon thread from a JSR223 Groovy Sampler that > refreshes ONE token every 50 minutes for as long the thread is running. > That happens in a setup thread group and therefore before any other thread > group. > > In the two simulated thread groups I placed a JSR223 Groovy Sampler to get > the token from the props variable (it is currently a AtomicReference to > make it safer for JMeters access model). > Then a http sampler (that will fail because of an invalid DNS name) uses > that token. > > If thread group uses a lot of time for each round, place the get token > logic inside a JSR223 Timer. That should run before each sampler on the > same level or downwards. > > When all thread groups are done the teardown thread group will try to stop > the daemon thread with another groovy script. > > Maybe that helps you as a starting point. > > Felix > Am 27.02.26 um 16:45 schrieb Abhitosh Patil: > > Hi, > > I have 4 thread groups in my JMeter script. > Run Thread Groups Consecutively (One at a time) option is ON. > > Now I want to add 1 more thread group at the top for session token > generation. It should generate fresh session token after every 55 minutes. > > I can't uncheck Run Thread Groups Consecutively option. > > How can I handle this? > > Thanks in advance. > > Abhitosh Patil > > > --0000000000001769aa064c7607f1--