đź““
Loadium Wiki
  • Welcome to Loadium
  • Getting Started with Loadium
  • Quick Start
  • Common Reasons For Execution Fails
  • Create Test
    • JMeter Test
    • Locust Test
    • Script Builder
    • Gatling Test
    • WebDriver Test
    • HLS Test
    • Understanding Test Reports
  • ABOUT LOADIUM
    • Features
    • Pricing
    • VUH - Virtual User Hour
  • ACCOUNT
    • Profile & Account
    • Subscription
  • Audit Log
  • Features
    • Test Report
    • Compare Test
    • Report PDF Export
    • Private Location
  • Test Settings
    • Split CSV
    • Sandbox
    • Multi-Step
    • Geolocation
    • Customize Setup
    • Dedicated IP
    • Send Email
    • DNS Override
    • TPS
    • Network Type
    • Test Scheduling
    • Test Failure Settings
    • JMeter Settings
    • Failure Criteria
    • Flexible Thread Scheduling
    • File Output
  • CONTINUOUS INTEGRATION SUPPORT
    • Azure DevOps Pipeline
    • Jenkins Load Testing with Loadium
  • Integrations
    • Microsoft Teams Integration
    • New Relic Integration
    • AppDynamics Integration
    • TeamCity Integration
  • Jmeter Corner
    • Built-in JMeter Functions
    • How to Install JMeter Plugins
    • Record and Play Load Testing With Jmeter in 5 Steps
    • Websocket with Apache JMeter
    • JMeter Timers
    • Handling Error Messages of JMeter Tests in Loadium
    • Details of Throughput Controller in JMeter (Splitting Threads to Different Requests)
    • How to Add a Varying Number of Parameters in Apache JMeter
    • Local Network Simulation On JMeter
    • Running Load Test with FTP Server
  • Gatling Corner
    • Introduction to Gatling
    • Gatling Recorder
    • Gatling Pros&Cons
Powered by GitBook
On this page
  • Websocket Samplers Plugin For Jmeter
  • Example Case

Was this helpful?

  1. Jmeter Corner

Websocket with Apache JMeter

PreviousRecord and Play Load Testing With Jmeter in 5 StepsNextJMeter Timers

Last updated 3 years ago

Was this helpful?

It’s apparent that the usage of Websocket has expanded greatly in recent years, and its reliability is expected to be high since it mostly carries crucial information to clients. Hence, their durability and reliability has become more important.

It is possible to execute on Websockets with Apache by using “Websocket Samplers” plugin developed by Peter Doornbosch.

Websocket Samplers Plugin For Jmeter

Let’s take a look at the first.

You can download the plugin .

Once you install the plugin, you will get 7 new Sampler elements:

  • Websocket Close: Closes the current Websocket connection

  • Websocket Open Connection: Initiates a new connection with given parameters, with options for connection&read timeouts

  • Websocket Ping/Pong: Performs a ping or ping/pong service for the current connection

  • Websocket Sampler: A single sampler that performs one-time request.

  • Websocket Single Read Sampler: Reads response without sending a request.

  • Websocket Single Write Sampler: Sends a request without reading the response

  • Websocket request-response Sampler: Does both sending a request and reading response

Example Case

Websockets’ behavior may reveal differences between each other, but the structure of a script for Websocket is usually similar to the following format:

  • Initiating a connection with Websocket

  • Sending the first request

  • Receiving the first request

  • Using a looper (Runtime controller or Loop Controller etc.) to continue the data transmission between the client and the server by sending a message and receiving it.

-First, we need to start a connection with the Websocket. It can be done either using “Websocket Open Connection”, or “Websocket Request” with the “setup new connection” option.

-The information about the sockets needs to be given. For example, you can find the socket’s information from Google Chrome’s Inspect mode>Network>WS

-There is one another situation that requires a token that is received by another request for a Websocket to initiate a connection.

-When the connection has started, there will be a series of messages that will be transferred from both the client and the server-side. Some of the requests going from the client might be unique, but at some point, repetitive pattern requests can be seen and it will be imitated with a loop logic. Additionally, this repetitive pattern usually has a constant interval between requests, which might need to be taken into account.

That's it, happy testing!

If you don't see the answer to your question here, please to let us know! We're always improving our documentation.

testing
performance tests
JMeter
plugin
here
JMeter Test
reach out to us