Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup JMeter proxy to record activities on a local web application

Tags:

proxy

jmeter

I'm new to JMeter and I want to load test a local web application recording test case with JMeter proxy.

I've first followed instruction here http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf and all worked fine.

Than:

  • I launched my web application, say http://localhost:8080/my-application
  • Setup JMeter web proxy on port 8081
  • Added an HTTP Request Default to a Thread Group
  • Addea a Recording Controller
  • Invoked curl -X GET http://localhost:8081/my-application/index.html

I obtain:

  • Request are recorded but with wrong parameters, eg. https instead of http
  • I don't get the requested page with curl, but the exception: org.apache.http.client.ClientProtocolException: URI does not specify a valid host name: https:///my-application/index.html/my-application/index.html
  • The parameters I've specified in Http Request Default seems to be ingnored? I placed configuration element under HTTP Proxy Server, and tried many settings.

What's going wrong? I missed some basic configuration? I'm using JMeter Proxy in the wrong manner?

like image 530
CARCARLO Avatar asked Jan 24 '13 12:01

CARCARLO


People also ask

How do I record a web app using JMeter?

In JMeter, by adding a Non-Test element to your test plan, enables you to capture the network traffic. Right click on Test Plan > Add > Non-Test Elements > HTTP(S) Test Script Recorder. This will add the recording capability to JMeter. To begin recording, understand the business flow and have your input data ready.

How set proxy in JMeter properties file?

First check that you have the correct proxy parameters like Proxy Server IP/address,port no,username and password. Then, in the first HTTP Request, click on advanced tab and there you find Proxy server section. Fill the required information and run the jmeter.


2 Answers

Firefox by default does not allow localhost or 127.0.0.1 to be proxied.

You have to modify a setting in about:config

change network.proxy.allow_hijacking_localhost to true

like image 162
slashdottir Avatar answered Sep 23 '22 08:09

slashdottir


Firefox default setting will bypass "localhost, 127.0.0.1" from proxy so your JMeter still not able to record it. You have to empty the "No Proxy for" field, by removing the "localhost, 127.0.0.1". Hope this will help.

like image 42
stanicmail Avatar answered Sep 26 '22 08:09

stanicmail