java - Jmeter Sequencing A Flow -Multiple Threads (Using REST API Token ) -


i trying test following scenario using jmeter.

step 1. login request (which returns token)  step 2. calling one.api uses token returned in step 1.  step 3. calling two.api uses token returned in step 1.  step 4. logout. 

i able achieve above scenario 1 thread works fine.

now requirement run same stuff 10 users.

1. 10 login requests should performed. 2. 10 calls one.api should made using 10 different tokens generated. token should not repeated of calls api. 3. 10 calls two.api should made using 10 different tokens generated. token should not repeated of calls api. 4. 10 log out request. 

i tried assign multiple token, example token1,token2,token 3 etc, can use same one.api dynamically, using http header passing token header value. below not working.

x-auth-token value assigned ${$token${__threadnum}} 


dynamic variable names not seems working, there other way of doing same stuff.

it won't work way, jmeter doesn't support nested variable reference, need use 1 __v() or __evalvar() function like:

  • ${__v(token${__threadnum})}

or

  • ${__evalvar(token${__threadnum})}

so composite variable value evaluated.

nested function variable

see how use jmeter functions posts series advanced information on above , more jmeter functions.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -