I am new to scala and gatling. I am trying to inject cookie in my request but its not working. Here is the code:
val scn = scenario("Home Page").repeat(1) { exec(addCookie(Cookie("token","12345").withDomain(".example.com").withMaxAge(Int.MaxValue))) .exec(http("Getting Data") .get("/api/clearance") .check(status.is(200)) ) }
Request:
`
HTTP request:
GET http://example.com/api/clearance
headers=
Accept: /
Accept-Language: en-US,en;q=0.8
User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36
Cookie: cookiesAccepted=1
Accept-Encoding: gzip, deflate, sdch
Host: example.com
`
I am using gatling as gradle dependency:
`
dependencies {
testCompile ‘io.gatling.highcharts:gatling-charts-highcharts:2.2.5’
}
`
My scala version: 2.12.2