I'm working on Android application and we use okhttp3 to open websocket connection to our backend. There are 2 main websocket:
- request-response mechanism for requesting information from backend.
- subscribe mechanism for receiving broadcast or notify from backend.
The problem is I cannot simulate subscribe flow in JMeter and Postman. The flow in Android is
- Login to the system using username-password through REST API, the server return token
- Create new OKHttp Websocket Client
- Send WebSocket Request to backend, tell them which message I want to subscribe.
- Wait for the message from the backend.
Then I create test plan as follows:
- [CSV Data Set Config username] Get username-password from .csv file
- [HTTP Login Request] Calling REST API to login
- [WebSocket Open Info] Open WebSocket Connection
- [WsSubscribeReq] Send a message to backend telling the message code I want to subscribe (same format as the message used in Android).
- [WebSocket Single Read Broadcast] Loop wait for incoming message.
I was running my Android application at the same time as I running JMeter, Android got the broadcast message but JMeter did not get any message.
How can I make this works?

In its current form the question cannot be comprehensively answered so I can only give you a generic hint: given you send the same request you should be getting the same response.
Pay attention to literally everything, URL query string, headers, payload which can contain non-printing characters
It also worth enabling JMeter debug logging for the plugin by adding the next line to log4j2.xml file:
and checking server-side logs for any suspicious entries.