Hi All,
Parameter value for Name is not being replaced in the below script
val httpProtocol = http // 4
val scn1 = scenario(“Login”)
.feed(Data4)
.exec(session =>session.set(“guid”, randomUUID().toString))
.exec(session =>session.set(“myString”, “{\n\t"Name” : “${Name}”\n}"))
.exec(session => {
println( “myString is :” + session(“myString”).as[String] )
session
})
.exec(session =>session.set(“DigitalSign”, randomStringGenerator.getSignature(“C:\Working\private_key.pem”, “{\n\t"Name” : “${Name}”\n}")))
.exec(http(“CreateAccount”)
.post(“https://XXXXXXXXX.co.uk/v1/test”)
.body(StringBody("{\n\t"Name" : “${Name}”\n}"))
.header(“Authorization”, “Bearer XXXXXXXXXXXXXXX==”)
.header(“DigitalSignature”, “${DigitalSign}”)
.header(“X-Request-Id”, “${guid}”)
.header(“Content-Type”, “application/json”)
.check(status.is(200)))
setUp(scn1.inject(atOnceUsers(1))).protocols(httpProtocol)
Is there a way i can execute a custom function with parameters, as shown above?
Thanks in advance.
Regards,
Prash.