amazon-web-serviceswebsocketjmeterjmeter-pluginsweb-api-testing

Using Jmeter Websocket sampler with no port number in the URL


I'm working with a websocket api thats hosted on AWS. The URL doesn't have a port number. But the Jmeter websocket plugin by Peter Dornbosch requires a port number in the URL in order to function.

When I leave it as empty it gives the error response: Sampler error:Port number is '' is not a number. Does anybody know what to do in this scenario?


Solution

  • You opened this site without specifying port, however it runs on port 443 and if you explicitly specify the port like https://stackoverflow.com:443 URL it will open just fine.

    The same applies to WebSockets, as per specification

    By default, the WebSocket Protocol uses port 80 for regular WebSocket connections and port 443 for WebSocket connections tunneled over Transport Layer Security (TLS)

    so use port 80 for ws:// protocol and port 443 for wss:// protocol.

    More information on WebSockets testing with JMeter: JMeter WebSocket Samplers - A Practical Guide