Unable to set Cookie for a request

Hi All,

I am trying to set cookie in the request but it fails with below error. I am new to scala and gatling.

sh bin/gatling.sh

GATLING_HOME is set to /Users/rmkanda/Downloads/gatling-charts-highcharts-bundle-2.3.1

10:42:43.372 [ERROR] i.g.c.ZincCompiler$ - /Users/rmkanda/Downloads/gatling-charts-highcharts-bundle-2.3.1/user-files/simulations/CRecordedSimulation.scala:32: ‘)’ expected but ‘}’ found.

10:42:43.374 [ERROR] i.g.c.ZincCompiler$ - }

10:42:43.375 [ERROR] i.g.c.ZincCompiler$ - ^

10:42:43.386 [ERROR] i.g.c.ZincCompiler$ - one error found

10:42:43.389 [ERROR] i.g.c.ZincCompiler$ - Compilation crashed

sbt.compiler.CompileFailed: null

at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:111)

class CRecordedSimulation extends Simulation {

val httpProtocol = http
.baseURL(“https://capable.herokuapp.com”)
.inferHtmlResources()
.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 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0”)

val headers_0 = Map(
“Cache-Control” → “max-age=0”,
“If-None-Match” → “”“W/“10ad-y7+G78qCUjCKlVAMiSy1RkhVnU4"””",
“Upgrade-Insecure-Requests” → “1”)

val uri1 = “https://127.0.0.1/api/offerings

val scn = scenario(“CRecordedSimulation”)
.exec(http(“request_0”)
.exec(addCookie(Cookie(“connect.sid”, “s%3ANmT9ax1QoeKdaMXHsfjAHs-Ogy4ussnzmcG.iPUayRMn%2F6wNALTTvcB79Yc%2Bd%2BbiCz3cNEAcbbbpaa13Xc”))
.get("/api/offerings")
.headers(headers_0))

setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)
}

Try counting matching parens…

It worked…

val scn = scenario(“CRecordedSimulation”)
.exec(addCookie(Cookie(“connect.sid”, “s%3ANmT9ax1QoKaMXHfjAHs-.iPUaRMn%%2Bd%”)))
.exec(http(“request_0”)
.get("/api/offerings")
.headers(headers_0))