Git Product home page Git Product logo

Comments (7)

fshutdown avatar fshutdown commented on September 12, 2024

The HTTP to WebSocket protocol upgrade is a part of the sampler code so I'm not sure whether you need both in your scrtipt.

WebSocket sampler will return response with message index marker like this:

[Message 1]
MySessionIdNumberIsHere

I would imagine that you RexEx pattern (^.*) would match only the first line (i.e. [Message 1])
The following expression will be better siuted:

\[Message 1\]\s(.*)

from jmeter-websocketsampler.

thgv avatar thgv commented on September 12, 2024

"The HTTP to WebSocket protocol upgrade is a part of the sampler code so I'm not sure whether you need both in your script"

In the line above, are you referring to Http request sampler and websocket sampler when you say both?

I just replayed the jmeter test script and this is what I found in the response tab of view Results Tree for the first socket io request  (http://host:8085/socket.io/1/%3Et=1392300599780:
6WIKeXU5vvqqyVYcaa1E:60:60:websocket,htmlfile,xhr-polling,jsonp-polling

I did not see the message index marker...
I tried the expression you suggested but same result as before. Request failed and view Results Tree shows nothing in request and response tabs.
 
I saw this in the Sampler results:

Thread Name: WebSocketTest3 1-1
Sample Start: 2014-02-13 09:10:00 EST
Load time: 25053
Latency: 0
Size in bytes: 0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 0
Response code: 200
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
 - Waiting for messages for 20000 MILLISECONDS
 - WebSocket conection closed by the client
[Variables]
 - Message count: 0

Not sure if there is anything helpful there...
Thanks.

On Thursday, February 13, 2014 4:54 AM, Maciej Zaleski [email protected] wrote:

The HTTP to WebSocket protocol upgrade is a part of the sampler code so I'm not sure whether you need both in your scrtipt.
WebSocket sampler will return response with message index marker like this:
[Message 1]
MySessionIdNumberIsHere
I would imagine that you RexEx pattern (^.) would match only the first line (i.e. [Message 1])
The following expression will be better siuted:
[Message 1]\s(.
)

Reply to this email directly or view it on GitHub.

from jmeter-websocketsampler.

thgv avatar thgv commented on September 12, 2024

Hi,
I added HTTP cookie manager in the thread group so cookie handling is automatic for all http requests. However would this work for the websocket sampler request? If it does not, how can I handle it manually for this request?
Thanks.

On Thursday, February 13, 2014 9:33 AM, Thara Vadakkeveedu [email protected] wrote:

"The HTTP to WebSocket protocol upgrade is a part of the sampler code so I'm not sure whether you need both in your script"

In the line above, are you referring to Http request sampler and websocket sampler when you say both?

I just replayed the jmeter test script and this is what I found in the response tab of view Results Tree for the first socket io request  (http://host:8085/socket.io/1/%3Et=1392300599780:
6WIKeXU5vvqqyVYcaa1E:60:60:websocket,htmlfile,xhr-polling,jsonp-polling

I did not see the message index marker...
I tried the expression you suggested but same result as before. Request failed and view Results Tree shows nothing in request and response tabs.
 
I saw this in the Sampler results:

Thread Name: WebSocketTest3 1-1
Sample Start: 2014-02-13 09:10:00 EST
Load time: 25053
Latency: 0
Size in bytes: 0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 0
Response code: 200
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
 - Waiting for messages for 20000 MILLISECONDS
 - WebSocket conection closed by the
client

[Variables]
 - Message count: 0

Not sure if there is anything helpful there...
Thanks.

On Thursday, February 13, 2014 4:54 AM, Maciej Zaleski [email protected] wrote:

The HTTP to WebSocket protocol upgrade is a part of the sampler code so I'm not sure whether you need both in your scrtipt.
WebSocket sampler will return response with message index marker like this:
[Message 1]
MySessionIdNumberIsHere
I would imagine that you RexEx pattern (^.) would match only the first line (i.e. [Message 1])
The following expression will be better siuted:
[Message 1]\s(.
)

Reply to this email directly or view it on GitHub.

from jmeter-websocketsampler.

fshutdown avatar fshutdown commented on September 12, 2024

By the look of things the sampler did not manage to establish a WebSocket connection with the server. There could be few things here:

  • You are using incorrect protocol; only ws and wss can be used which is equivalent of HTTP and HTTP respectively
  • There are problems with the server certificate;; use Ignore SSL certificate errors to get around this problem
  • You cannot connect directly without going through the proxy
  • The server is using WebSocket implementation not supported by this sampler; currently only RFC6455 is supported

Rerarding cookies you will have to handle this manually for now. You can add header called Cookie with cookie values in the WebSocket sampler

Example:

Cookie: name=value; name2=value2

from jmeter-websocketsampler.

thgv avatar thgv commented on September 12, 2024

Thank you.
I am using ws and not wss. This is the protocol to use.
I can connect directly without going through the proxy.
Not sure what websocket implementation my server is using. I am looking into it.
I tried to handle the cookie manually,debug sampler shows the variable carrying the right value, but I get an error when replaying this socket.io request. In view results tree, request tab is empty and response tab shows 7:::1+0
Thanks.

from jmeter-websocketsampler.

redguy666 avatar redguy666 commented on September 12, 2024

We had similar issue and solved it upgrading Java VM 1.7 -> 1.8

from jmeter-websocketsampler.

prutheel avatar prutheel commented on September 12, 2024

I am getting same response "7:::1+0" even After changing the Protocol to WSS and Upgrading to JAVA 1.8

[Execution Flow]

  • Opening new connection
  • Using response message pattern ""
  • Using disconnect pattern ""
  • Waiting for the server connection for 20000 MILLISECONDS
  • WebSocket conection has been opened
  • Connection established
  • Received message #1 (7 bytes); matched response pattern
  • Waiting for messages for 800000 MILLISECONDS
  • Leaving streaming connection open

Here is my Sampler configuration:

Path: socket.io/1/websocket/${socid}
Connection ID: ${socid}
Request DATA: 5:::{"name":"join","args":["Ag_10","${GUID}"]}
Response Pattern: (Blank)
Close Connection Pattern: (Blank)

What could I have missed? If anyont know Please do let me know...I am new at this Websocket thing so looking for help

from jmeter-websocketsampler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.