JMeter does not pass token when executed in non-gui mode

glider

I have two threads groups. The first one generate a token that is passed to the second thread group. I use a json extractor and a beanshell assertion in the first group to make the token visible for the second thread. It works perfectly in gui mode but in non-gui mode the token always is generated correctly but is not passed to the second thread so it fails, returns status 401.

Do you have any idea why this happen and a solution?

Edit: I have a global user defined variable element. There I have a var called token_type with the value global_token. Then in the second thread I have a http header manager where I have a header called Authorization with the value Bearer ${__V(${token_type})}

Dmitri T
  1. Since JMeter 3.1 it's recommended to use JSR223 test elements and Groovy language for scripting so consider migrating
  2. Unless you have a very specific use case it would be a better idea to move samplers into a single Thread Group, this way you won't have to pass the token between thread groups at all, moreover each thread (virtual user) would have its own token as JMeter Variables are local to the threads
  3. You may find Inter-Thread Communication plugin easier to use, in this case the 2nd thread group will "wait" until the token becomes available

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Does the property file reader works in jmeter non gui mode

Non gui mode does not provide advantage in my test in Jmeter?

jmeter.log file overrides each time when jmeter launched in GUI as well as NON GUI mode

log assertion result in NoN GUI mode[Jmeter]

Jmeter Non GUI mode timestamp date format

Graph Results via Non GUI mode in JMeter

Configuring result file data when running JMeter in non-GUI mode

Properties from properties file are not used, when run jmeter test in NON GUI mode

Getting "Uncaught Exception BUG! exception in phase 'semantic analysis'" errors when jmeter runs in NON-GUI mode

set a variable in jmeter postprocessor and access in command prompt in NON GUI mode

JMeter Non-GUI-Mode one logfile for every sampler

JMeter result log does not include parent samples while running in NON-GUI mode, I need the parent samples

What does it mean when code is executed in [kernel|user] mode?

In Jmeter how to record/capture only error sampler data in raw JTL file through non gui mode?

JMeter non-GUI mode taking longer than expected with minimal load

Trouble accessing properties set by JSR223 Sampler in JMeter non-GUI mode

Error while trying to merge results from different JTL files using the MergeResults PLUGIN in JMETER NON GUI mode

how to get throughput of samples while running jmeter in non-GUI mode?

How to get header values in .csv file generated in non gui mode of jmeter

JMeter create custom .jtl log for each sampler in non-GUI mode

JMeter 500- Internal Error while running 100 users for the first time in Non-GUI mode

Non GUI Jmeter run with Listener

When does the non-static block get executed in java?

Trying to run a JMeter test using a docker container for JMeter (non GUI mode) throws error "Could not open xxxx.jmx file"

How to start JMeter in GUI-mode?

Jmeter NullPointerException when running the GUI

"java.lang.IllegalArgumentException: Results log file is not empty" error showing while generate dashboard report for Non GUI mode in jmeter3.0

Uncaught Exception java.lang.OutOfMemoryError: "unable to create new native thread" error occurring while running jmeter in non gui mode

`token` does not live long enough when pass into the HeaderValue in rust