I have used the websocket open connection sampler request in my project. URL: wss://sip-qa.forestreettelco.com:11443 while executing the jmeter script getting the Response message:"http upgrade failed with status code 400" Please help me.enter image description here
1 Answers
As per HTTP Status Code 400 description
The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
So my expectation is that you're sending the wrong request which doesn't match what your server expects. As it is not publicly available I cannot come up with the proper configuration, however I believe you should start with normal HTTP Request sampler and add the following Headers to the request:
- Connection:
Upgrade
- Upgrade:
websocket
- Whatever other headers which real browser sends like
Sec-WebSocket-Protocol
,Sec-WebSocket-Version
,Sec-WebSocket-Key
, etc.
The headers can be added using HTTP Header Manager
You can capture browser traffic using built-in browser developer tools or an external sniffer tool like Wireshark.
Once you will be sending the same sequence of the same requests you should get the same responses as for the real browser.