API (accessible via jumpbox server) testing using JMeter

25 views Asked by At

I need to load test an API that can be accessed only using a Jumpbox server. I am able to hit the API in my command prompt by ssh tunnelling and a curl command. I read so many articles, which says after I ssh tunnel, I should be able to hit the API using my Chrome browser. But unfortunately I can't. I get 403 error on Chrome, as well as on JMeter. Can anyone please help? I have added the SSH command and the curl command that I used.

ssh -L 8801:qa.aws.test.com:8080 [email protected]
curl -XPOST "http://test.aws.test.com:8080/customers"  -H "Content-Type: application/json" -d '{ "customer": "123456"}'
1

There are 1 answers

0
Dmitri T On

You're using the wrong port.

ssh -L 8801:qa.aws.test.com:8080 command instructs SSH client to listen on the port 8801 on your local machine and forward all traffic to port 8080 @ qa.aws.test.com

So you should use http://localhost:8801/customers URL in Chrome, JMeter, cURL or whatever.

  • If you want to use cURL - there is Import from cURL JMeter dialog where you can put your command

    enter image description here

  • If you want to use JMeter's HTTP(S) Test Script Recorder - make sure to configure your browser to use proxy for local traffic as well

  • You can also consider using JMeter Chrome Extension, in this case you won't have to worry about proxies, SSL certificates and so on.