Hi Stephene,
help me please,
i have some lines of code which is useful to store some data into session,
but i am unable to store data into session,
and based on the session data,i request for some other data through url like bellow (in request processing there i am using session data) ,
val dataVo=voMethod.getVos()val compData=new HashMapList[String],List[String]
compData.put(dataVo.get(0),dataVo.get(1))
val dataKey=100
val scn2=scenario("").exec(session => {
import io.gatling.http.cookie._
import java.net.URI
val newSession = (session(“gatling.http.cookies”).asOption[CookieJar].flatMap { cookieJar =>
val cookie = cookieJar.get(URI.create("[")).find(_.getName == compData)
cookie.map(session.set(“Key”+dataKey,com****pData)) ------------------------------------------------------------------------------------------i am getting error here while set data into session
}).getOrElse(session)
newSession
})
val httpProtocol = http
.baseURL(“url”)
.disableFollowRedirect
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”)
.doNotTrackHeader(“1”)
.acceptLanguageHeader(“en-US,en;q=0.5”)
.userAgentHeader(“Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0”)
.disableResponseChunksDiscarding
.connection(“keep-alive”)
val scn = scenario(“scenario”)
.exec(http(“GETdata”)
.get(dataKey+“geturl”))
setUp(scn.inject(atOnce(1 user))).protocols(httpProtocol)