'Websocket Request Response Sampler' fails with response: 'Unexpected frame type (close)'

Issue #139 closed
Vishnu Udayakumar created an issue

Sampler version: JMeterWebSocketSamplers-1.2.2.jar
Jmeter version : 4.0

I am trying to jmeter script for a chat app. I am able to successfully correlate the session id and fire the subsequent requests till 2probe (which returns a 3probe). But the next one fails, in which I am trying to send a message using ‘websocket request response sampler' (Request data: 42["chat message","Test Message"]). The following is the sampler result from jmeter. Could you tell me what’s going wrong with this request.

ps: The sample app is hosted in my local machine.

Jmeter Log

2019-11-20 10:14:50,990 DEBUG e.l.w.WebSocketClient: Creating connection with localhost:3000
2019-11-20 10:14:50,991 DEBUG e.l.w.WebSocketClient: >> GET /socket.io/?EIO=3&transport=websocket&sid=5mwgi9q_Z8sant0gAABD HTTP/1.1
2019-11-20 10:14:50,991 DEBUG e.l.w.WebSocketClient: >> Host: localhost:3000
2019-11-20 10:14:50,992 DEBUG e.l.w.WebSocketClient: >> Cookie: io=5mwgi9q_Z8sant0gAABD
2019-11-20 10:14:50,992 DEBUG e.l.w.WebSocketClient: >> Accept:  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
2019-11-20 10:14:50,992 DEBUG e.l.w.WebSocketClient: >> User-Agent:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:48.0) Gecko/20100101 Firefox/48.0
2019-11-20 10:14:50,992 DEBUG e.l.w.WebSocketClient: >> Accept-Language:  fr,en-US;q=0.7,en;q=0.3
2019-11-20 10:14:50,992 DEBUG e.l.w.WebSocketClient: >> Accept-Encoding:  gzip, deflate
2019-11-20 10:14:50,992 DEBUG e.l.w.WebSocketClient: >> Upgrade: websocket
2019-11-20 10:14:50,992 DEBUG e.l.w.WebSocketClient: >> Connection: Upgrade
2019-11-20 10:14:50,992 DEBUG e.l.w.WebSocketClient: >> Sec-WebSocket-Key: mkPGLeVVwPLW2gUJ6It2PA==
2019-11-20 10:14:50,992 DEBUG e.l.w.WebSocketClient: >> Sec-WebSocket-Version: 13
2019-11-20 10:14:50,992 DEBUG e.l.w.WebSocketClient: >>
2019-11-20 10:14:50,997 DEBUG e.l.w.WebSocketClient: << HTTP/1.1 101 Switching Protocols
2019-11-20 10:14:50,998 DEBUG e.l.w.WebSocketClient: << Upgrade: websocket
2019-11-20 10:14:50,998 DEBUG e.l.w.WebSocketClient: << Connection: Upgrade
2019-11-20 10:14:50,998 DEBUG e.l.w.WebSocketClient: << Sec-WebSocket-Accept: G8O3HVctjFepojr3m+z4KPadPLk=
2019-11-20 10:14:50,998 DEBUG e.l.w.WebSocketClient: << 
2019-11-20 10:14:51,001 DEBUG e.l.j.w.RequestResponseWebSocketSampler: Sampler '2probe - WebSocket request-Reponse Sampler' received text frame with text: '3probe'
2019-11-20 10:14:51,003 ERROR e.l.j.w.RequestResponseWebSocketSampler: Unexpected frame type received in sampler 'ChatMessage': Close frame with status code null and close reason 'null'
2019-11-20 10:14:51,005 INFO o.a.j.t.JMeterThread: Thread is done: Scenario 1 1-1
2019-11-20 10:14:51,006 INFO o.a.j.t.JMeterThread: Thread finished: Scenario 1 1-1
2019-11-20 10:14:51,006 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2019-11-20 10:14:51,007 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

Sampler Log

Thread Name: Scenario 1 1-1
Sample Start: 2019-11-20 09:28:59 IST
Load time: 1
Connect Time: 0
Latency: 0
Size in bytes: 0
Sent bytes:39
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): 
Response code: Sampler error: unexpected frame type (close).
Response message: Received: Close frame with status code null and close reason 'null'

Response headers:


SampleResult fields:
ContentType: 
DataEncoding: null

Comments (9)

  1. System Testing

    I am now facing the same issue. able to successfully correlate the session id and fire the subsequent requests till 2probe (which returns a 3probe). But the next one fails, in which I am trying to send a message using ‘websocket request response sampler' (Request data: 42["handshake", {username: "xxxx"}]).. I tried to add WebSocket Single Write Sampler with request data 5 before the failed request, but even after that it got failed. Please advice what you have used to resolve this.

  2. Log in to comment