websocket sampler throwing Null response while opening socket connection - websocket

The version of jmeter i'm using is 5.3
and the setting I'm using here is https://prnt.sc/zothxr for the web socket
I need to give load in the websocket using this jmeter & websocket

Looking into the plugin source code it appears that the session is not established so you might need to check your hostname/path/implementation and look at server and JMeter log files, it might be the case you didn't install the necessary dependencies or something like this.
Also the plugin you're using is kind of outdated so I would recommend switching to JMeter WebSocket Samplers by Peter Doornbosch, it can be installed via JMeter Plugins Manager and it has more features comparing to the version you're using.
More information: JMeter WebSocket Samplers - A Practical Guide

Related

Apache JMeter Test Script Recorder gRPC HTTP/2 support

I want to load test a web application server which communicates through gRPC (which uses HTTP/2 for transport) with the clients.
It seems that Apache JMeter extended by the plugin JMeter gRPC Plugin and JMeter gRPC Request sampler would be perfect for this.
Among other things JMeter provides a Test Script Recorder which helps quickly generate scenarios by acting as a HTTP proxy between the client and the server.
Question 1: Is it possible to use the JMeter Recorder for recording the communication through the gRPC protocol?
Question 2: Is it possible to use the JMeter Recorder for recording the communication through the underlying HTTP/2 protocol?
I have tried already the JMeter Recorder to record the gRPC communication without success :-( Maybe caused by wrong configuration of the recorder?
No, at least not with JMeter 5.5
No, as of JMeter 5.5 the HTTP(S) Test Script Recorder doesn't support HTTP/2. Neither it does support .proto files so even if you record the raw packets you won't be able to decode them into anything meaningful
So I would recommend using a sniffer tool like Wireshark for capturing the packets between client and the system under test and then replicating the same using JMeter's GRPC sampler.

Multiple Parallel Websocket connections to SignalR hub in JMeter

We are trying to load test our login workflow, by simulating 50+ users logging into our front-end, via the API calls. As part of the login process, we make a websocket connection to a SignalR hub(Connect). We then send a call over the websocket connection to a custom endpoint in SignalR(Login), used to add some data to the Redis cache, then do some stuff which isn't important, then send a call to a different custom endpoint over the websocket connection(Logoff) and then Disconnect the websocket connection.
So my question is multi-part:
How do we create a websocket connection from within JMeter?
How do we make a call to a custom endpoint over the websocket connection in JMeter
How do we do this for multi users simulated to be running in parallel, so we can test the load? In other words, we need multiple websocket connections open / alive from JMeter so we can test the load.
Note: Please be aware, I'm asking this on behalf of the load tester/JMeter developer, but because they are new to Stack Overflow, and I understand the SignalR side, I've been asked to log it. I know zip about JMeter, so please handle me like a noob trying to help someone solve a frustrating but important problem.
JMeter per se doesn't support WebSockets, you will need a special plugin if you want to enable this functionality.
The most advanced, comprehensive and supported as of now is JMeter WebSocket Samplers by Peter Doornbosch, it can be installed using JMeter Plugins Manager
Once you install the plugin and restart JMeter you will see several new samplers which will allow to open connection, send request, read response, and close connection.
Unfortunately I cannot guide you further because I don't know the specifics of your application, just look into your browser developer tools or other sniffer tool and configure JMeter to send the same requests as your browser (or other application) does.
More information:
Test SignalR Performance with JMeter
JMeter WebSocket Samplers - A Practical Guide
samples directory contains several example test plans covering different scenarios

JMeter recording use non http/https protocol

I am recording our game app using JMeter
And it has an API server, which using the WebSocket's protocol
While meeting that request sent to API server, I always get this message, and can't go further
Is that means I need to modify the original JMeter's source code to walk around this problem? Or any way out? If so, that'd be appreciated.
I don't think you will be able to record and replay WebSocket transport using JMeter's HTTP(S) Test Script Recorder as WebSocket is a different beast, given you have a game application my expectation is that it might be the case application opens a WebSocket connection and re-uses it until the end of session and so you won't be able to mimic this behavior using "normal" HTTP Request samplers as WebSocket assumes either ws or wss protocol.
I would suggest considering one of the following JMeter Plugins:
WebSocket Sampler by Maciej Zaleski
WebSocket Samplers by Peter Doornbosch
Both plugins can be installed using JMeter Plugins Manager:

JMeter API Testing - Recording the Incoming Traffic

Using JMeter, the HTTP Request is hitting a URL with the port.
Eg : apitesting.com:8888/api/series/one
I have also added a HTTP Test Script Recorder in JMeter, where I can mention the port and domain.
How do I import the incoming traffic to JMeter using tcpreplay and JMeter Proxy for the above example.
Thanks for your help in Advance.
Have you read the FAQ?
Does tcpreplay support sending traffic to a server?
If by server you mean a daemon (Unix) or service (Windows) which listens on a port (a web or mail server would be common examples), then probably not. The biggest issue is that tcpreplay doesn't understand the state of common protocols like TCP. This means it is unable to synchronize Syn/Ack's to create valid TCP sessions.
So you have the following options:
Consider using Wireplay tool instead
Convert your .pcap file into JMeter .jmx script using BlazeMeter JMX Converter
In both cases be aware that you will get only a "skeleton" of the project, you won't be able to replay production traffic, all you will get would be a set of HTTP Request samplers, you will have to figure out the workload model on your own.
In JMeter you can add to your HTTP request a Post Processor Named Response Assertion, If you check the Ignore Status checkbox you will ignore response of the server so even if server is down it'll not fail test and continue.

Stress testing WebSockets in Jmeter

I'm trying to stress test my WebSocket server using Jmeter's plugin (jmeter-websocket). The thing is that the plugin comes with no documentation how to work with it and thus I'm not sure if my expectations of it is supported or not.
I managed to run a sample test using the mentioned plugin and it was successfully connected to server. It also managed to communicate with server but once it was done receiving the first response it disconnected. I was hoping to configure this plugin in a way so it will maintain a persistent connection with WebSocket server for several minutes, sending and receiving a couple of messages before it is disconnected.
By stress testing I would like to see how the number of concurrent connections affect my application's behavior. Is this plugin suitable for my needs? If it is then how should I work with it?
I had exactly the same problem. the plugin you have mentioned worked only for a HTTP-like request/response but I couldn't use it for a "long" connection.
Have a look at this http://github.com/maciejzaleski/JMeter
Features:
Supports HTTS/HTTPS (ws/wss) version of the WebSocket protocol
Option to ignore SSL certificate errors
Streaming allows for a single connection to remain open for the duration of the test
Response has to match predefined regular expression
Response timeout
Response message backlog (build the Sampler response from multiple server messages)
Connection could be closed if server sends a message matching predefined regular expression
As of November 2017, the best Websocket Sampler for Apache JMeter is this 3rd party plugin:
https://bitbucket.org/pjtr/jmeter-websocket-samplers
It can easily be installed through jmeter-plugins plugin manager.

Resources