Hi All,

12 views
Skip to first unread message

Muhammad Islam

unread,
Mar 5, 2022, 10:59:31 PM3/5/22
to BlazeMeter Forum
I am facing an issue while using session token from setup thread group to other thread group. An error occurred.

{
  "errors" : [ {
    "errorType" : "UnrecognizedClientException",
    "message" : "The security token included in the request is invalid."
  } ]
}

I am using beanshell assertion to set the property after extracting the session token as follow. 
${__setProperty(sessionToken, ${sessionToken})};

Snag_651db082.png

Session token generated in setup thread group is 

"IQoJb3JpZ2luX2VjEBwaCXVzLWVhc3QtMSJGMEQCIHReSY5txSh46K20orMhwjn5HXbiUbSwmFrqaa2FV5l5AiA9MRVMEssSEPh1Pwss/YQvjP63UnAk32m33WnBpW7cLSrNBAiE//////////8BEAAaDDgyNjI1ODc0NDExMCIMGh9ppw9I1IWyM1gtKqEEVpzGFJK+h9l1qb8rY9t5bpQiJqjBM7YU9PmMPDrNfZG9OAs1uJYKdvAl8Efl9rstlLAw9fRuw3qLO71A50roZ32kQRBkXH/es4WTKKlCZ9p7NQTTbmA6wDmVkd7oksmHQRZoYGJQZejasOoZfApky4seqd1uQnlyK4FlnfKJ81ANx0w0Zcfr+rYClHM/qZL6JU2V2dwnTbQOYSOwZ3lvf0d6Pf96i305tY9Rm0bgScOGigr/GneRP7EiBzjAeavCNt8fZcAjiCGgOAnPW1JWtRgiX0vZsneEVCLmZPSHXPFKt1jh0BKzpwBrzgTLb7iDAhZPgFcOKMezs6dwIhiWBQiTvjWI/ci72Lr3+5Vb2qtN4FdrsS6YPJokF40eNEH2tgOmq6yPbKv/kOHfvZgLUQ7Cik+bYofx9aW2KeXWWxuKNHxJlHegJnGE6a4AVifnrTnuLOE6Clv6cwCT9ry49Eh3qa6YqQy/yIDZPsnKNKsJ1YF3uHkwDsxQW6mXgfGEos666jHUb2ipssgTgKMGGHaYa5GfY5fenqEhTiepF0DwpJoZu0QWWYIHeacwcdcBTYjZIFIjvOZGqMmIbcmZTyoLxeL2XC5NvDvDcIyPmwLVmtVs2zWkPizEQRq7nLnSfOCv6D8W50466LblXgSDzXDnCAfxIgZcTzmO6+UZAXq6Vi7BtpDA8iFHH99MCnnWq55wY3i6wL+HtX+0K/SsDhkwqc+QkQY6hgJR/DqbQKAkQ3+5slBd7JCDVtkYAPlAwQChFp4RSWRGUMFDIQq0DAZR4+IrRZToS/5PN5himETbJ95zCyZWrkHrrM8YAMNpT3QE+ZJNXh8WPit/kctEC3KYwZon4qYR/bnx8flR+uTSHp6jVwX0GshRVYvA3sb3u8cgRWzoyQFHrVGiI3ehPwlXfehPjeM/dEoRWu9gf60iKL5cdWCDTEmeVx8OT7reWu2mka9uxV4i4HMJ8K0AyGZoaB4FlnfHgBaRhDQd4Ym53dpxDbNyVM5ixsIj/8G/g67Kz4H9gC5RGZYucW/IplZMT0Te9VaNzb0/LlZ5UFGR8Z0cE8P3df6tZATmu3Dr"

Retrieving session token in other thread using ${__property(sessionToken)} in header but receiving above error. 

Snag_652086c4.png

where as while using in header for further request in another thread group it is breaking due to  ////////// as per my understanding not sure. session_token_issue.jpg

Complete test plan looks like below

Snag_65247879.png

Please help. 

Thanks,
Muhammad Islam

Dmitri T

unread,
Mar 7, 2022, 3:15:28 AM3/7/22
to BlazeMeter Forum
We don't know how did you extract the token and how it should look like. I would suggest using "network" tab of your browser developer tools to find the token in the response and in the next request and compare the values, it might be the case you need to encode or decode the token somehow.

Also be aware that starting from JMeter 3.1 you should be using JSR223 Test Elements and Groovy language for scripting, for 1 thread Beanshell is okay, but in case of using scripting for multiple threads/virtual users consider migrating to Groovy.
Reply all
Reply to author
Forward
0 new messages