# gatling 3.0.x to have web socket check from the main HTTP flow (like 2.3.x)

**URL:** <https://community.gatling.io/t/gatling-3-0-x-to-have-web-socket-check-from-the-main-http-flow-like-2-3-x/4751>\
**Category:** Gatling (Open-Source)\
**Created:** [January 14, 2019, 9:14am UTC](https://community.gatling.io/t/gatling-3-0-x-to-have-web-socket-check-from-the-main-http-flow-like-2-3-x/4751 "2019-01-14T09:14:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AMRITA\_KUMARI](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@AMRITA\_KUMARI](https://community.gatling.io/u/AMRITA_KUMARI)\
**Post date:** [January 14, 2019, 9:14am UTC](https://community.gatling.io/t/gatling-3-0-x-to-have-web-socket-check-from-the-main-http-flow-like-2-3-x/4751/1 "2019-01-14T09:14:23Z")

</div>

Hi,  
I am trying to upgrade gatling from 2.3.x to 3.0.x and I am facing difficulties in implementing the web socket check.  
I have one web socket request which would receive multiple web socket responses(say 3 for now) so, my question is if I could put my check on the 2nd response ?

Can we have ws-request with multiple ws-responses check or it has to be in request-response manner.

Like with gatling 2.3.x we had `exec(ws("Set Check").check(myCheck))` where we didn’t need to compulsorily fire a websocket request to get the response. How do I achieve the similar behavior with gatling 3.0.x

Thanks,  
Amrita

---

<div class="post-metadata">

**Author:** ![AMRITA\_KUMARI](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@AMRITA\_KUMARI](https://community.gatling.io/u/AMRITA_KUMARI)\
**Post date:** [January 16, 2019, 10:39am UTC](https://community.gatling.io/t/gatling-3-0-x-to-have-web-socket-check-from-the-main-http-flow-like-2-3-x/4751/2 "2019-01-16T10:39:00Z")

</div>

I somehow got the solution.  
So, if we have 1 request and 3 responses and the reqex that we are looking for is in response 2, we have to first put the **matching criteria** which would filter out the ws response for us and then, the **check criteria** which would correctly get us the result.

For example:

```auto
ws.checkTextMessage("my customizable checkName")
    .matching(regex(".*login successful.*")))
    .check(regex(".*login successful.*"))

```

If we don’t put the **matching criteria** , the check would be executed on the first response that we get for the ws request. But, with this approach we can work with async ws model also, where we don’t have the request-response ws flow.

---

<div class="post-metadata">

**Author:** ![Katerina\_Stepanova](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@Katerina\_Stepanova](https://community.gatling.io/u/Katerina_Stepanova)\
**Post date:** [January 18, 2019, 1:49pm UTC](https://community.gatling.io/t/gatling-3-0-x-to-have-web-socket-check-from-the-main-http-flow-like-2-3-x/4751/3 "2019-01-18T13:49:42Z")

</div>

Thank you for this hint about matching!  
This same problem with WS checks was preventing me from migrating to Gatling 3.
