0

How can I replace "details1" in "request_2" with correlated value "SynchToken" from "request_1". I am trying to replace with ${SynchToken} but it is not reflecting the correlated value.

val Transaction_Name_1 = group("Transaction_Name_1") {
  exec(http("request_1")
    .get(session => "/abc/details1?_=" + System.currentTimeMillis())
    .check(regex("""name="SYNCHRONIZER_TOKEN" value="(.*?)"""").saveAs("SynchToken")))
  .pause(5)
  .exec(http("request_2")
    .get(session => "/abc/details1?_=" + System.currentTimeMillis()))
}
Karan
  • 45
  • 9

1 Answers1

2

You should really spend some time reading the documentation. Here, you need to use the Session API.

exec(http("request_2")
    .get(session => "/abc/" + session("SynchToken").as[String] + "?_=" + System.currentTimeMillis()))
Stéphane LANDELLE
  • 6,076
  • 2
  • 10
  • 12