Hi,
I am trying to execute a sequence of chains and setting a session attribute in between somewhere. The problem is this variable is not getting set correctly and I get an error saying No attribute named ‘toUpdate’ is defined. Here is the code
No attribute named ‘toUpdate’ is defined
scenario(“Test”).exec(postChain("/orders", Helper.generateRequestBody(order)))
.exec(getChain("/orders", “${id}”))
.exec((session: Session) => {
val jsonString = session(“object”).as[String]
val pojo = Helper.generatePojo(jsonString, classOf[Order]).asInstanceOf[Order]
pojo.setName(pojo.getName + “Updated”)
val toUpdate = Helper.generateRequestBody(pojo)
session.set(“toUpdate”, toUpdate)
session
}
)
.exec(putChain("/orders", “${id}”, “${toUpdate}”))
I want to do the chains in this sequence POST → GET → UPDATE → DELETE and need the toUpdate attribute for the PUT request . Any suggestions?
Thanks,
Akash