Hello,
Could you please help with String variable “cardNumber” substitution in following scenario.
In following scenario except cardNumber, rest of variables are read from CSV file which seem to use Gatling DSL.
how to enable string substitution only for cardNumber in this context.
private def sendAuthenticationRequest(merchantId: String, cardNumber: String) = {
http(“Authentication”)
.put( “”"/api/rest/version/${version}/merchant/""" + merchantId + “”"/order/${oid}/transaction/""" + tId)
.basicAuth(“merchant.” + merchantId, “${apipassword}”)
.body(StringBody(
“”"{
“apiOperation”: “AUTHENTICATION”,
“sourceOfFunds”: {
“provided”: {
“card”: {
“number”: s"${cardNumber}", // This method does not seem to enable Scala string substitution
}
}
}
}""".stripMargin)
)
.check(status.is(SC_CREATED))
.check(jsonPath("$…result").find.is(“SUCCESS”))
}
When I try to run this, getting error as "No attribute named ‘cardNumber’ is defined
Best Regards,
Raja