Checking Socket.io messages

Hello,

I’m working on load testing of my application. I would like to test the web socket part which implemented with socket.io node module.
On the server side of my application socket io send a event named “[POSV - INIT]” when a client has subscribed to a room and i would like to check that gatling client receive this message.
For now i’m only able to connect to web socket and i receive only message containing the session id “sid”.
Is it possible to check the reception of a special event in gatling ?
Here is my actual scala gatling code:

object SocketIoScenario {

val httpProtocol =
http
.baseUrl(app_url)
.wsBaseUrl(app_ws_url)
.userAgentHeader(“gatling”)
.wsAutoReplySocketIo4

val scn =
scenario(“SocketIo”)
.exec(ws(“Connect to WS”)
.connect(“/socket.io/?EIO=4&transport=websocket&roomName=LIG:IDFM:C01742”)
.onConnected(
exec { session =>
println(“Connected”)
session
}
)
.await(60)(wsCheck))
.pause(120)
.exec{ session =>
println(“Disconnect”)
ws(“Close WS”).close
session
}

private def wsCheck = {
ws.checkTextMessage(“check-received-message”).check(regex(“.vehicleActivity.”).saveAs(“message”))
}

}

Thank’s in advance for help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.