import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class RecordedSimulation extends Simulation {
val httpProtocol = http
.baseURL(“http://115.249.227.253:85”)
.inferHtmlResources(BlackList("""..js""", “”"..css""", “”"..gif""", “”"..jpeg""", “”"..jpg""", “”"..ico""", “”"..woff""", “”"..(t|o)tf""", “”"..png"""), WhiteList())
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,/*;q=0.8")
.acceptEncodingHeader(“gzip, deflate”)
.acceptLanguageHeader(“en-US,en;q=0.5”)
.userAgentHeader(“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0”)
val headers_0 = Map(“Upgrade-Insecure-Requests” → “1”)
val headers_1 = Map(
“Accept” → “/”,
“Pragma” → “no-cache”)
val uri1 = “http://detectportal.firefox.com/success.txt”
val uri2 = “http://xxxxxxxxxx:xx/SampleApplication”
val scn = scenario(“RecordedSimulation”)
// AppLaunch
.exec(http(“request_0”)
.get("/SampleApplication/login")
.headers(headers_0)
.resources(http(“request_1”)
.get(uri1 + “”)
.headers(headers_1)))
.pause(16)
// Login
.exec(http(“request_2”)
.post("/SampleApplication/login")
.headers(headers_0)
.check(regex(""“value=”(.*?)"""").saveAs(“personId”) )
.formParam(“ssoId”, “test1”)
.formParam(“password”, “test1”)
.formParam("_csrf","${personId}"))
.pause(48)
I am trying to capture the csrf token for my app I got No attribute named 'personId is defined Kindly help on this