Hi,
I’m trying to run a soak test with the below simulation. The problem that I’m facing is that after some time, the system receives the following error :
status.is(200), but actually found 504
status.is(200), but actually found 500
status.is(200), but actually found 408
post the introduction of the above errors, my simulation started logging errors due to : no attribute named ‘csrfToken’ is defined
var scn: ScenarioBuilder = scenario(“Soak Test”)
.exec(Auth.auth)
.pause(1 second, 10 seconds)
.during (1 hour) (
exec(Stream.one)
.pause(1 second, 10 seconds)
.exec(Stream.two)
.pause(1 second, 10 seconds)
.exec(Stream.three("${status}"))
.pause(1 second, 10 seconds)
.exec(Stream.three(“Available”))
.pause(1 second, 10 seconds)
.exec(Stream.four)
.pause(5 seconds, 10 seconds)
)
.exec(Auth.logout)
the csrfToken is being extracted from the Auth :
val auth: ChainBuilder = feed(Config.csvFeeder)
.exec(http("/ui/auth")
.post(":443/ui/auth")
.header(“content-type”, “application/x-www-form-urlencoded”)
.header(“user-agent”, “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36”)
.formParamSeq(
Seq((“uid”,"${userName}"),
(“pass”,"${password}"))
)
.check(status.is(Config.success)))
.exec(
getCookieValue(CookieKey(“TOKEN”)
.withDomain(System.getProperty(“baseUrl”))
.withPath("/ui")
.withSecure(true)
.saveAs(“csrfToken”))
)
val one: ChainBuilder = exec(http("/endpoint")
.post("/endpoint")
.header(“x-csrf-token”, “${csrfToken}”)
.body(
ElFileBody(“bodies/streams/email/email-stream-req.json”)
).asJson
.check(status.is(Config.success))
.check(jsonPath("$…id").saveAs(“caseId”))
.check(jsonPath("$…caseNu").saveAs(“caseNu”)))
Wanted to understand why is the simulation unable to find the variable which was working fine previously before the introduction of these errors