How to handle Auth_token for serial users(working with one user but failing with more than one user)
Scenario-If the website issues login token for individual user then how we can pass login token to individual thread as currently it is working with one user but failing for multiple users
See the code below
exec(
http("GuestToken")
.post(uri20 + "/secure/token/guest")
.headers(headers_5)
.check(jsonPath("$..access_token").saveAs("Access_Token")) // Saving token in this section
)
Map<CharSequence, String> headers_7 = new HashMap<>();
headers_7.put("Accept", "application/json, text/plain, */*");
headers_7.put("Pragma", "no-cache");
headers_7.put("Sec-Fetch-Dest", "empty");
headers_7.put("Sec-Fetch-Mode", "cors");
headers_7.put("Sec-Fetch-Site", "same-site");
headers_7.put("access_token", "#{Access_Token}");
headers_7.put("contract_id", "");
headers_7.put("curated_catalog_id", "");
headers_7.put("currency", "currency");
headers_7.put("foruserid", "");
headers_7.put("language", "en");
headers_7.put("preview_token", "");
headers_7.put("store_id", "OSLOESite");
We are getting below error on terminal
19:17:05.638 [ERROR] i.g.h.a.HttpRequestAction - 'httpRequest-3' failed to execute: No attribute named 'Access_Token' is defined
19:17:05.639 [ERROR] i.g.h.a.HttpRequestAction - 'httpRequest-2' failed to execute: No attribute named 'Access_Token' is defined