Hi all, I managed to do what you want but only in hacky way:
val initStarted = new AtomicBoolean(false)
val initCompleteLatch = new CountDownLatch(1)
scenario("myScenario")
.doIf(_ => initStarted.getAndSet(true) == false) {
exec(http("first")
.get("/endpoint")
.check(status.is(200),
jsonPath("$..response.id").findAll.saveAs("reponseVariable")
)
).exec { session =>
reponseVariable = session("reponseVariable").as[String]
initCompleteLatch.countDown()
session
}
}
.exec { session =>
initCompleteLatch.await()
session.set("reponseVariable", reponseVariable)
}
.exec(http("second")
.post("/another/endpoint/{responseVariable}")
.body(...)
.check(status.is(200))
)
Hope it helps :) It can chain serveral requests, passthrough response along, and ensures first request is send only once.
International Futures (IFs) is a thinking tool for our global future. It was developed to assist people who are interested in personal and social choices lying ahead.
I. Ciuciu, and Y. Tang. On the Move to Meaningful Internet Systems: OTM 2010 Workshops, volume 6428 of Lecture Notes in Computer Science, Springer Berlin Heidelberg, (2010)
M. Maguire, and N. Bevan. Proceedings of the IFIP 17th World Computer Congress - TC13 Stream on Usability: Gaining a Competitive Edge, page 133--148. Deventer, The Netherlands, The Netherlands, Kluwer, B.V., (2002)
A. Sutcliffe. Proceedings of the 11th IEEE International Conference on Requirements Engineering, page 320--. Washington, DC, USA, IEEE Computer Society, (2003)