Checks on Websocket responses in different objects

Hi all

I am using Gatling 2.2.3 running via the SBT plugin. Our website at the moment is a mix between https requests/responses and Websocket requests/responses, for example I may need to post some data via https and check the response via the websocket. I have organised certain actions into Objects e.g. Login, Send Order etc. and these are then built up into different Scenarios which are Classes, extending Simulation in the usual way. The issue I have is that I open the Websocket in one Object, the Login, but need to check a response to a https response on that same websocket in another Object. Here I am slightly stuck and have something like the below - I seem to have to put a Open or sendText command after the exec otherwise it won’t compile the “check” statement - but I don’t really need to send a ping or anything at all here, I just want to check as the request is sent just before it in a https exec.


.exec(ws("Check Order Response")
       .check(wsAwait.within(2 seconds).until(1).jsonPath("$.response.instrument.symbol").is(StringBody("""${instrument.underlying.symbol}${instrument.expiration.code}""")))
       .check(wsAwait.within(2 seconds).until(1).jsonPath("$.response.instrument.expiryDate").is(StringBody("""${}""")))


Can anyone advise or help? The above works by the way, I wish I could just get rid of the ping!

Thanks :slight_smile: