Hi guys,
I’m currently developing a Play Framework application with websockets and I want to do some load test with Gatling.
When I test my application opening a webserver from Chrome Dev tools everything looks ok:
But when I try to do the same with Gatling I get “Invalid status code 0”. I think there is no problem without Gatling … I think the problem is with Play but I’m not sure… I have tested my Gatling test with http://www.websocket.org/echo.html and it works.
My Gatling test:
class BasicTest extends Simulation {
val httpConf = http
.baseURL(“http://localhost:9000”)
.wsMaxReconnects(1)
.header(“Sec-WebSocket-Version”, “13”)
.header(“Sec-WebSocket-Extensions” , “permessage-deflate client_max_window_bits”)
.acceptLanguageHeader(“en-US,en;q=0.5”)
.acceptEncodingHeader(“gzip, deflate”)
.userAgentHeader(“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36”)
.wsBaseURL(“ws://localhost:9000”)
val scn = scenario(“WebSocket”)
.exec(ws(“Connect WS”).open("/socket"))
.pause(10)
.exec(ws(“Close WS”).close)
setUp(scn.inject(rampUsers(1) over 1.seconds)).protocols(httpConf)
}
I get a similar error using wscat
I’m new in websockets stuff… so, any idea about what’s going on will be appreciated.
Regards,
Sergi