Get Cookie not defined error

I m seeing this error while retrieving cookie value from script
" .exec(getCookieValue(CookieKey(“JSESSIONID”).withDomain(“xxx.xx-xx.testing.xxxx.cloud”).withPath(“/ietp-s1000d/”)))
.exec { session =>
println(session(“JSESSIONID”).as[String])
session
}"

Error. how to fix this?

16:40:28.905 [ERROR] i.g.c.a.b.SessionHookBuilder$$anon$1 - ‘hook-1’ crashed on session Session(ACM Token,1,Map(gatling.http.ssl.sslContexts → io.gatling.http.util.SslContexts@2ee1f94b, gatling.http.cache.dns → io.gatling.http.resolver.ShufflingNameResolver@660df2cb, gatling.http.cookies → CookieJar(Map(CookieKey(_b1626,xxx.xx-xx.testing.xxxx.cloud,/) → StoredCookie(_b1626=13698f8cb87356d0, path=/,true,false,1711624228842), CookieKey(jsessionid,xxx.xx-xx.testing.xxxx.cloud,/ietp-s1000d/) → StoredCookie(JSESSIONID=23BB1BE174AA47FE6C965DA76BBCB910, path=/ietp-s1000d/, secure, HTTPOnly,true,false,1711624228842))), gatling.http.referer → https://corena.dal-triage.testing.flatirons.cloud/ietp-s1000d/getAdminLoginDialog.do),KO,List(),io.gatling.core.protocol.ProtocolComponentsRegistry$$Lambda$543/0x000000080064c840@1966308e,io.netty.channel.nio.NioEventLoop@226b143b), forwarding to the next one
java.util.NoSuchElementException: No attribute named ‘JSESSIONID’ is defined
at io.gatling.core.session.SessionAttribute.as(Session.scala:48)
at AcmTokenSimulation.$anonfun$1(AcmTokenSimulation.scala:26)
at io.gatling.core.action.SessionHook.execute(SessionHook.scala:38)
at io.gatling.core.action.Action.$bang(Action.scala:42)

Any updates on this topic? Im stuck here

when i try to use set-cookie
.check(
header(“Set-Cookie”).saveAs(“setCookie”) // Save the Set-Cookie header
)
)

I m seeing this error

Found: ("Set-Cookie" : String)
Required: io.gatling.core.session.Expression[CharSequence]
Note that implicit conversions cannot be applied because they are ambiguous;
both getter CharSequenceCaster in object TypeCaster and getter StringCaster in object TypeCaster match type io.gatling.commons.util.TypeCaster[T]

can someone reply? what a loser community?

First, developers are French, you can check time zone so that you can predict when they can reply you.

Second, call other loser when you can’t even put your script in code format, that’s a bit hilarious.

Lastly, not like everyone has faced your issue.
Weird.

3 Likes