Run Websocket check after HTTP Response

Hi,

I’m working with a server that will send a series of websocket messages over an open connection once it receives a certain post request.

So I’m trying to check for a certain websocket response after posting via http without sending any websocket message from the client.

Something like this:

exec(ws("Connect WS").connect("wss://..."))

// causes the server to send a websocket message
exec(http("Exec Post")
  .post("https://...")
  .check(status.is(201))
).pause(1.second)

// how to run this check expecting a certain websocket message after the http response?
ws.checkTextMessage("Check Websocket Response").check(jsonPath("..."))

Does anyone know if that’s possible with Gatling 3?

Thanks in advance,
Sören

Hello mate,
try to give check as ws.checkTextMessage(“Check Websocket Response”)…check(wsListen.within(30 seconds).until(1).regex("\{blabla\}"))

Thanks,
Raj