How can I send numeric values in Web Socket single write sampler ?

Issue #70 closed
Deviga created an issue

I am testing an internal chat application of my organisation. Implementing my pings via web socket single write samplers. When I send numeric values in the write sampler, the chat server is not able to read it as a number.

I tried with multiple option. Wrote bean shell and created integer and string values to pass it in the request. But at last it is passed as 'text' only. So the chat server is not able to understand the ping.. and giving default responses..

Could you please assist me to solve this ? I attached the screens for your reference. Please check..

Comments (4)

  1. Peter Doornbosch repo owner

    Hi Deviga,

    The websocket protocol defines two types of data frames: text and binary. Text is supposed to carry UTF-8 encoded text, binary can be anything of course.

    You need to find out:

    • which one your server uses
    • what the protocol is your server talks

    Tools like WireShark can help a lot to investigate what conversation a "normal" client is having with your server. Once you know that, you'll be able to convert it to a test-plan without the trail-and-error you're currently facing...

    Regards, Peter

  2. Deviga reporter

    Thanks peter. I checked the server logs. This is not because of the numeric value. Sorry for the 1st assumption.

    The numeric values are sent properly. But it is sent in a new session, so the chat buddy was unable to recognize what it it. So, the problem is, each and every ping is passed in new frame/new session. The session is closed as soon as the response arrived.

    I tried the web socket sampler, request-Multiple Frames in single connection.jpgresponse and read-write. Issue is same.

    Attached the screens for you. Can you help me on how to keep the session alive or send multiple pings in the same session with continuity..Error for the numerics sent.jpg

  3. Peter Doornbosch repo owner

    Hi Deviga,

    These last two screenshots show that you were using Maciej Zaleski's sampler, which isn't compatible with this plugin.

    For additional help requests, please attach your testplan or a relevant part of it so i can see how you are using the samplers.

    Regards Peter

  4. Log in to comment