Rushabh Doshi wrote:
Hi All,
We need to do performance testing for Viewer (PDFTron viewer) functionality for
that we make WebSocket call to get some file data which requires multiple
requests and responses within single connection of a WebSocket.
So, I have tried to use WebSocket Sampler by using JMeter plugins manager but
getting response like - Cannot connect to the remote server​
------------------------------------------------------------------------------------------------------
SAMPLER RESULT
[Execution Flow]
- Opening new connection
- Using response message pattern ""
- Using disconnect pattern ""
- Waiting for the server connection for 5000 MILLISECONDS
- Cannot connect to the remote server
[Variables]
- Message count: 0
[Problems]
- Unexpected error: null
JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage(ServiceSocket.java:189)
JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:141)
org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651)
org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570)
org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501)
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)
java.lang.Thread.run(Unknown Source)
------------------------------------------------------------------------------------------------------
So, how can we achieve multiple requests within same WebSocket connection?
Could you guide me on this please?
Thanks,
Rushabh
Try switching to JMeter WebSocket Samplers by Peter Doornbosch
<https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/master/>
The project is more "alive" and samplers have more features.
You will have an *open connection sampler***which allows explicitly
opening a websocket connection, *single read, single write and
request/response* samplers with possibility to re-use the existing
connection and *close connection sampler* when you don't need the
connection anymore.
Basic request-response sample with explicit open.jmx
<https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/master/samples/Basic%20request-response%20sample%20with%20explicit%20open.jmx>
sample test plan demonstrates the usage.
More information just in case: JMeter WebSocket Samplers - A Practical
Guide <https://www.blazemeter.com/blog/jmeter-websocket-samplers>