I’m still unable to parse the session value stored in one request into other.
I’ve two http requests
val scn = scenario(“Device”)
.feed(csvFeeeder)
.exec(http(“Auth Header gene)
.post(”/auth")
.headers(headers_0)
.formParam(“type”, “device”)
.check(headerRegex(“auth”,“device*”).saveAs(“authH”))
.check(status.is(401)))
.exec(http(“Signed Req”)
.post("/auth/oauth")
.headers(Map(
“x-id” → “${id}”,
“x-serial” → “${serial}”,
“Authorization” → test.dummy))
.formParam(“type”, “device”))
the test.dummy is a function which converts the saved string “authH” into some format and that converted output needs to be passed to the “Authorozation” header in my second request. for that purpose I’m using something like this
object test{
def dummy: String = {
val = (Here I need to get the saved authH session attribute)
— logic to convert into my required format–
return convertedString
}
}
I was unable to get the sessionAttribute there. Is there a way to get the sessionAttribute. Please HELP. I go through the Gatling documentation but could not find any solution