Hi Stéphane,
How Gatling can wait for X minutes after sending a Websocket request. I had tried to achieved by adding X times .await() but this is not the correct solution(highlighted below code). Please help.
protected def scorecardFanScenario2: ScenarioBuilder = scenario(“Scorecard websocket FanScenario”)
.exec(ws(“open socket”).connect("/listen").subprotocol(“graphql-ws”).header(“Sec-WebSocket-Protocol”, “graphql-ws”))
.exec(ws(“connection init”).sendText(connection_init)
.await(20)(ws.checkTextMessage(“connection_ack”).check(regex(".ack.").saveAs(“Message”)))
)
.exec(session => session{
println(session(“Message”).as[String])
session
})
.exec(ws(“Match Scorecard request”).sendText(matchCardScorePayload).await(400)(ws.checkTextMessage(“IN_PROGRESS”).check(regex(".IN_PROGRESS.").saveAs(“Message3”)))
.await(400)(ws.checkTextMessage(“IN_PROGRESS”).check(regex(".IN_PROGRESS.").saveAs(“Message3”)))
.await(400)(ws.checkTextMessage(“IN_PROGRESS”).check(regex(".IN_PROGRESS.").saveAs(“Message3”)))
.await(400)(ws.checkTextMessage(“IN_PROGRESS”).check(regex(".IN_PROGRESS.").saveAs(“Message3”)))
.await(400)(ws.checkTextMessage(“IN_PROGRESS”).check(regex(".IN_PROGRESS.").saveAs(“Message3”)))
.await(400)(ws.checkTextMessage(“IN_PROGRESS”).check(regex(".IN_PROGRESS.").saveAs(“Message3”)))
.await(400)(ws.checkTextMessage(“IN_PROGRESS”).check(regex(".IN_PROGRESS.").saveAs(“Message3”)))
.await(400)(ws.checkTextMessage(“IN_PROGRESS”).check(regex(".IN_PROGRESS.").saveAs(“Message3”)))
.await(400)(ws.checkTextMessage(“IN_PROGRESS”).check(regex(".IN_PROGRESS.").saveAs(“Message3”)))
.await(400)(ws.checkTextMessage(“IN_PROGRESS”).check(regex(".IN_PROGRESS.").saveAs(“Message3”)))
)
.exec(session => session{
println(session(“Message3”).as[String])
session
})