Search code examples
websocketjmeter

How to Perform Websocket Load Testing through JMETER?


Can We Record Websocket Through JMETER or Blazemeter? If no then How to add websocket manually in JMETER ?

Can someone please explain me in detail how to add websocket in JMETER manually?

enter image description here How we can add this data using Websocket Sampler ?

Update :

I followed same steps and Added Thread Group > Websocket Open Connection > Websocket Request Response Sampler> View Result Tree enter image description here I am getting this Response code:302 Response message:Got unexpected status 302 with statusLine:HTTP/1.1 302 Found Can you please help me to resolve this?

enter image description here


Solution

  • Can We Record Websocket Through JMETER or Blazemeter?

    No, you can record only HTTP or HTTPS protocols

    Can someone please explain me in detail how to add websocket in JMETER manually?

    First of all JMeter doesn't support WebSockets out of the box, you will need to install the plugin which adds this functionality. For example JMeter WebSocket Samplers is a good candidate. It can be installed using JMeter Plugins Manager.

    Second add WebSocket Open Connection sampler and specify your server details there like protocol, hostname, port and path:

    enter image description here

    Third add WebSocket request-response Sampler and put your payload data there:

    enter image description here

    Repeat above step for every request you need to simulate.

    More information: JMeter WebSocket Samplers - A Practical Guide