Comments (13)
have the same problem
from jmeter-websocketsampler.
I am experiencing same problem. Any pointers would be helpful please
from jmeter-websocketsampler.
Same issue also not able to provide a loop to generate unique Websocket connections anyone can help?
from jmeter-websocketsampler.
Same issue when I run a thread group with thread numbers larger than 1. Any existing solution to fix it?
from jmeter-websocketsampler.
When I track in the code, I see that the session is null actually (session.getRemote().sendString(message); ) and before that, onOpen method wasn't called.
from jmeter-websocketsampler.
Hello,
I amd using SignalR of Microsoft and I had the same issue: I digged into problem by using wireshark. I found out that Server was returning "http 500".
On my side, Solution for this:
Encode Token and ConnectionToken on jmeter.
Then next problem appeared: "Http 400" occured.
I found another problem java.net.URI.
The code in WebSocketSampler.java is like this:
URI uri = new URI(protocol, null, domain, -1, path , queryString, null);
ın this case querystring was encoded 2 times so the connectiontoken was encoded 2 times, therefore, Server can not understand connectiontoken so it returns HTTP 400.
So I fixed the code like this:
URI uri = new URI(protocol, null, domain, -1, path + "?" + queryString, null, null);
And Recompiled and installed with maven and put it in Jmeter.
Now It is working on my side quite well.
I hope it will help.
Cheers,
from jmeter-websocketsampler.
Hi,
I cannot find the source code in WebSocketSampler.java:
URI uri = new URI(protocol, null, domain, -1, path , queryString, null);
Could you give more detailed info?
Thanks.
from jmeter-websocketsampler.
https://github.com/maciejzaleski/JMeter-WebSocketSampler/archive/version-1.0.2.zip
src\main\java\JMeter\plugins\functional\samplers\websocket\WebSocketSampler.java
Line 228
Line 230
from jmeter-websocketsampler.
ceritandogan, Got it, thanks!
The problem is eased but not fixed completely yet.
Could you give the code fix details? Thanks!
My problem is when I run a thread group with thread number of n (n > 1), all the thread will failed to connect to the server except the last one always succeed.
Now with the fix, When n = 3, I got the last 2 threads succeed to connect to the server except the first one.
My fix done as ceritandogan gave:
if (isProtocolDefaultPort()) {
// return new URI(protocol, null, domain, -1, path, queryString, null);
return new URI(protocol, null, domain, -1, path + "?" + queryString, null, null);
}
// return new URI(protocol, null, domain, Integer.parseInt(getServerPort()), path, queryString, null);
return new URI(protocol, null, domain, Integer.parseInt(getServerPort()), path + "?" + queryString, null, null);
Also, I instrumented logs in WebSocket.java as below:
public void sendMessage(String message) throws IOException {
if (session != null){
logMessage.append(" - Session not null! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!").append("\n");
} else {
logMessage.append(" - Session null! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!").append("\n");
}
if (session.getRemote() != null)
logMessage.append(" - session.getRemote not null! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!").append("\n");
if (message != null)
logMessage.append(" - ").append(message).append(" - mssage! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!").append("\n");
session.getRemote().sendString(message);
}
The failed thread's sampler results:
[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
- Session null! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!
[Problems]
- Unexpected error: null
JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage(ServiceSocket.java:156) >JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:136) org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434) >org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261) java.lang.Thread.run(Unknown Source)
The code line numbers in the output are those of the origin source code before I changed any code.
The sampler results show that the session here is Null for the failed user. (- Session null! JMeter.plugins.functional.samplers.websocket.ServiceSocket.sendMessage!)
Any ideas?
from jmeter-websocketsampler.
@peer2peer I updated jetty to use version 9.3.9.M1 and I am no longer getting this error.
from jmeter-websocketsampler.
@peer2peer ,I also have this problem,Could you tell me how to solve this problem or giving me your JMeterWebSocketSampler-1.0.2-SNAPSHOT.jar which you have modified.Thanks~~~~
Thread Name: Thread Group 1-1
Sample Start: 2015-04-20 13:18:38 EDT
Load time: 5010
Connect Time: 0
Latency: 0
Size in bytes: 0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Response code:
Response message:
[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:147) JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:116) org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434) org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261) java.lang.Thread.run(Unknown Source)
Response headers:
SampleResult fields:
ContentType:
DataEncoding: UTF-8
from jmeter-websocketsampler.
@peer2peer, @conwilly88 & @x00350069 I have updated dependency to mentioned jar files, still facing the issue. Can you guys point me to right direction?
from jmeter-websocketsampler.
I also met this issue, @peer2peer, @conwilly88 & @x00350069 can you share a fixed jar file? Thanks.
from jmeter-websocketsampler.
Related Issues (20)
- Websocket testing JMeter Configuration
- extract().response() not working for REST assured. Getting error as "The method extract() is undefined for the type"
- How to identify disabled elements in dropdown in selenium with java? HOT 1
- WebSocket can't connect to remote server HOT 1
- Failing under heavy load HOT 4
- HTTP Header Manager parameters not passed
- Creating more threads on server than specified.
- can't receive expected response message for expected sampler
- Unable to create new connections per iteration- websocket sampler HOT 1
- Cannot get all data for frame
- excuse me?
- Unexpected error: null when run multiple threads
- WebSocket Sampler hangs on for 5000ms HOT 1
- Only the response pattern from first sampler is used
- java.util.LinkedList$ListItr.checkForComodification(Unknown Source)
- weird resizing of config window HOT 3
- WebSocket Connection "Got unexpected status 503"
- issue that i can't explain, on websocket sampler, the jmeter screen keeps on getting wider and wider HOT 4
- Able to connect to socket, but only getting sids and not message I expect
- unable send subprotocols in ws request
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jmeter-websocketsampler.