How to pass runtime variable (datetime) in scala

33 views
Skip to first unread message

pmour...@gmail.com

unread,
Jun 21, 2016, 10:53:26 AM6/21/16
to Gatling User Group, publis...@gmail.com
Hi All,

Consider the following scenario...


import java.util.Calendar

val timestamp = Calendar.getInstance.getTime   \\ I have defined the timestamp variable

Following my request which i wanted to pass the runtime datetime value.

.exec(http("request_6")
.post("/abcd/projects")
.headers(headers_29)
.formParam("Id", "5")
.formParam("extra", """{"inputproname":"+timestamp+","textareadesc":""")) \\ passing the same timestamp here

Scala script has been successfully executed but it created as name with << +timestamp+ >> instead of actual timestamp value

So can anyone tell me what am i doing wrong here? how to pass the time timestamp variable ???

Your help would be much appreciated.

Thanks,
Praveen

Reply all
Reply to author
Forward
0 new messages