Professional Documents
Culture Documents
JMeter VN
0. Preparation
https://jmetervn.com/2017/05/08/how-to-run-jmeter-behind-the-proxy/ 1/10
11/22/2017 How to run JMeter behind the Proxy JMeter VN
Then I created a basic test plan like the image below, it consists of 1 HTTP Request
Defaults and 1 HTTP Request which will access to the site jmeter.apache.org
If I dont cong anything and run the Test Plan above, you will see the similar error like
this:
Now, here we go. There are at least four ways to run JMeter behind the Proxy. Base on
what you need and what you want, to use the appropriate way.
1. Way 1
In the HTTP Request, you can nd out the Proxy Server section in the bo om of HTTP
Request element, from version 3.2, youll nd it out in the Advance tab of HTTP Request.
Now, input the information of Proxy Server into this section. In my example, because Im
using the Proxy Server with Host localhost(127.0.0.1) , Port 8888 and dont use
username/password. So I will input this information like image below
https://jmetervn.com/2017/05/08/how-to-run-jmeter-behind-the-proxy/ 2/10
11/22/2017 How to run JMeter behind the Proxy JMeter VN
If the Proxy Server doesnt have the hostname like localhost and has IP only, so we
will input that IP into Server Name or IP eld.
NOTE: If your proxy required username/password, please input them into the
corresponding eld Username and Password.
https://jmetervn.com/2017/05/08/how-to-run-jmeter-behind-the-proxy/ 3/10
11/22/2017 How to run JMeter behind the Proxy JMeter VN
2. Way 2
Imagine, if you have many requests, 100 requests for example, and youre using the way 1,
so you must input 100 times into those 100 requests, thats not a good idea, right? And in
case the Proxy Server is changed, you have to change in those 100 requests. So the idea is
to cong the Proxy Server into HTTP Request Default.
We will not input anything into the HTTP Requests, just open HTTP Request Defaults,
nd out the Proxy Server, and do the following:
NOTE: If your proxy required username/password, please input them into the
corresponding eld Username and Password.
https://jmetervn.com/2017/05/08/how-to-run-jmeter-behind-the-proxy/ 4/10
11/22/2017 How to run JMeter behind the Proxy JMeter VN
3. Way 3
> Launch JMeter from the command line with the following parameters:
-H
[proxy server hostname or IP address]
-P
[proxy server port]
-N
[nonproxy hosts] (e.g. *.apache.org|localhost)
-u
[username for proxy authentication if required]
-a
[password for proxy authentication if required]
Windows:
If your Proxy Server required username and password, use the command below
MAC:
or
NOTE: You can also use proxyHost, proxyPort, username, and password as
parameter names
Example:
After launching by this way, you can check the Proxy Server in JMeter by:
Right click WorkBench, select Add > Non-Test Elements > Property Display
Check the checkbox System, and see the information related to Proxy, it should display
the information of the Proxy Server which we launched from the command line above
Now, the JMeter is running behind the proxy, and you can run the test plan without any
other conguration. It should run normally
P/S: You can use this way, to run the normal Test Plan with specic proxy
Example:
Window:
https://jmetervn.com/2017/05/08/how-to-run-jmeter-behind-the-proxy/ 6/10
11/22/2017 How to run JMeter behind the Proxy JMeter VN
MAC:
4. Way 4
> Set the Proxy properties into the System properties le.
http.proxyHost
http.proxyPort
https.proxyHost
https.proxyPort
Example: I will cong the properties above into system.properties le with my Proxy
Server
http.proxyHost=localhost
http.proxyPort=8888
https.proxyHost=localhost
https.proxyPort=8888
If a non-proxy host list is provided, then JMeter sets the following System properties:
http.nonProxyHosts
https.nonProxyHosts
Example:
http.proxyHost=localhost
http.proxyPort=8888
https.proxyHost=localhost
https.proxyPort=8888
http.nonProxyHosts=example.com
https.nonProxyHosts=example.com
Open the JMeter, and try to check the System Properties as described in the way 3, you
should see the information like below:
https://jmetervn.com/2017/05/08/how-to-run-jmeter-behind-the-proxy/ 7/10
11/22/2017 How to run JMeter behind the Proxy JMeter VN
Now you can dene and run your test plan normally without any other conguration.
Advertisements
Published by harano1109
https://jmetervn.com/2017/05/08/how-to-run-jmeter-behind-the-proxy/ 8/10
11/22/2017 How to run JMeter behind the Proxy JMeter VN
Add Comment
2017 JMETER VN
https://jmetervn.com/2017/05/08/how-to-run-jmeter-behind-the-proxy/ 9/10
11/22/2017 How to run JMeter behind the Proxy JMeter VN
https://jmetervn.com/2017/05/08/how-to-run-jmeter-behind-the-proxy/ 10/10