I am using JMeter with the Peter Doornbosch WebSocket Sampler Plugin to test a WebSocket API. However, I am facing two issues:
Issue 1: ClassCastException Error When running the WebSocket request, I get the following error in the response:
Response message: Sampler error: java.lang.ClassCastException: class eu.luminis.websocket.PingFrame cannot be cast to class eu.luminis.websocket.DataFrame (eu.luminis.websocket.PingFrame and eu.luminis.websocket.DataFrame are in unnamed module of loader org.apache.jmeter.DynamicClassLoader @3af49f1c)
Has anyone faced this before?
How can I resolve this error?
Issue 2: Handling Multiple WebSocket Responses
Stack trace:
ERROR - jmeter.protocol.websocket: Sampler error: java.lang.ClassCastException:
class eu.luminis.websocket.PingFrame cannot be cast to class eu.luminis.websocket.DataFrame
at org.apache.jmeter.protocol.websocket.sampler.WebSocketSampler.sample(WebSocketSampler.java:123)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:260)
at java.lang.Thread.run(Thread.java:834)
Request payload:
{
"Id": ${id}
"Type":"creation"
}
My WebSocket request should return 4 responses, but I am only receiving the first response.
When I try running the WebSocket request again with the same payload, I do not get responses 2, 3, and 4. How can I configure JMeter to capture all responses in a single request? Setup Details:
JMeter Version: [5.6.3] WebSocket Plugin: Peter Doornbosch WebSocket Plugin Protocol: WebSocket WebSocket Server Behavior: Sends multiple responses for a single request
What I Have Tried:
Checked logs for errors. Tried increasing the timeout in the WebSocket sampler.
Experimented with different Response Aggregation settings in the plugin.
Would appreciate any guidance on how to fix the ClassCastException and properly capture multiple WebSocket responses in JMeter.
Thanks in advance!
Capturing Multiple Responses in JMeter WebSocket Plugin