I'm having some trouble with my JMeter test in regards to passing a variable to other requests in the same thread group.
I have 3 requests and one of them is a login request that is only executed once while other 2 requests are looping for one hour. The other 2 requests need to receive a variable 'access token' that is extracted from a login request response in order for them to return a status 200 response.
However, I notice in request header for those 2 requests that the variable 'access token' is not sent in the header although I receive that variable in login request response, extract it with JSON extractor and then send it in the request header.
This my test plan structure:
This is how I extract the variable from the login request:
...and this is how I send the 'access token' variable in request header for other 2 requests:
Everything worked fine until I added the If controller that executes the login request only once and I use this statement in If controller:
${__groovy(ctx.getThreadNum() == 0 && vars.getIteration() == 1,)}
The login request executes correctly and the 'access token' variable is located in the header response.
I can't figure it out, why doesn't variable gets passed to the other two requests?