Hi Stephane,
How do I use the ws.reconciliate in Gatling 3.x versions. I could not find a matching function that i could use in the latest versions.
Thanks and Regards,
Manjunath
Hi Stephane,
How do I use the ws.reconciliate in Gatling 3.x versions. I could not find a matching function that i could use in the latest versions.
Thanks and Regards,
Manjunath
WebSocket support since Gatling 3 is currently only blocking so there’s no need to reconcile.
Okay. But my flow that includes both HTTP and WebSocket seems to be not working after I switch from HTTP to web socket calls as shown below.
My subscribe call fails with an error saying the regex is failed. I was suspecting that authId from my http request is not able to get to the ws. What could be the possible issue in my script.??
val wsConnect = exec(ws("Pusher Connect").connect("XXXX")
.headers(Map("Accept-Encoding" -> "gzip, deflate, br", "Accept-Language" -> "en-US,en;q=0.9",
"Cache-Control" -> "no-cache", "Connection" -> "Upgrade", "Host" -> "XXXX",
"Origin" -> "[https://qa.old.alefed.com](https://qa.old.alefed.com)", "Pragma" -> "no-cache", "Sec-WebSocket-Extensions" -> "permessage-deflate; client_max_window_bits",
"Sec-WebSocket-Key" -> "hfhhfhf==", "Sec-WebSocket-Version" -> "13", "Upgrade" -> "websocket"
)).await(1 seconds)(ws.checkTextMessage("Pusher Get Socket ID")
.check(regex(".*pusher:connection_established.*"))
.check(regex("socket_id\\\\\\\":\\\\\\\"(.*)\\\\\\\",\\\\\\\"activity_timeout").saveAs("socketId")))
)
val authenticate = exec(http("Authenticate")
.post("/notifications/api/v1/push-notifications/authenticate")
.headers(Map("Content-Type" -> "application/x-www-form-urlencoded", "Sec-Fetch-Mode" -> "cors"))
.formParamSeq(Seq(("socket_id", "${socketId}"), ("channel_name", "presence-${userId}"), ("userId", "${userId}")))
.check(status.is(200))
.check(jsonPath("$.auth").saveAs("authId"))
)
val subscribe = exec(ws("Subscribe").sendText("""{"event":"pusher:subscribe","data":{"auth":"${authId}","channel":"private-${userId}"}}""")
.await(1 seconds)(
ws.checkTextMessage("Subscription Check").check(regex(".*subscription_succeeded.*"))
)).pause(1)
val wsClose = exec(ws("Pusher Close").close)