Running JMeter tests from behind a proxy server

Sometimes you may need to create and run your tests from behind a proxy server / firewall. For instance when you're on the LAN / intranet and need to connect to the outside. This is very easy to do so, but it can be hard to find out for the first time.

Configuring the proxy server

You need to launch JMeter with one or more of the following options:
-H [proxy server or IP address]
-P [proxy server port]
-u [username for the proxy authentication]
-a [password for the proxy authentication]
Examples:

  • jmeter.bat -H 192.168.10.1 -P 8012
  • jmeter.bat -H 192.168.10.1 -P 8012 -u my_user_name -a my_password
The easiest way is to create a new .bat file which launches jmeter.bat with the options above and place it in the JMeter bin directory. This way you can easily switch between JMeter and JMeter with proxy, without having to enter the settings again. Download an example bat file with proxy here.

Note: This proxy mechanism is different from the built-in Http proxy server. The http proxy server can be used to record http browser sessions and requires you to modify set the browser proxy settings.

Testing the proxy server settings

There are several ways to check if the proxy server settings are correct. I prefer to connect to a public webservice as it is very easy to do so, e.g. the one from amazon: http://soap.amazon.com/schemas3/AmazonWebServices.wsdl. Create a WebService(SOAP) request, fill out the WSDL url and click the "Load WSDL" button. The "Web Methods" dropdown gets filled with the available webservice methods. Congratulations, you correctly set the proxy server settings as you managed to reach the public webservice. Download the JMeter webservice request test file here.

You don't get the the list of methods, instead you get an exception message? Check if  you get one of these messages:

Error1: The WSDL was not valid, please double check the url. org.apache.jmeter.protocol.http.util.WSDLException: Connection timed out: connect.

  • The proxy server settings are probably incorrect, double check the proxy server and proxy server port
Error2: The WSDL was not valid, please double check the url. org.apache.jmeter.protocol.http.util.WSDLException: Server redirected too many times(20)

  • The username and password are probably incorrect, double check the correctness of these data
Error3: The WSDL was not valid, please double check the url. org.apache.jmeter.protocol.http.util.WSDLException: http://soap.amazo.com/schemas3/AmazonWebServices.wsdl


  • The webservice is probably not up, or you made a typo like I did in the url above: amazo instead of amazon. Paste the url in a browser and check if you get an xml-like file describing the webservice.

Did you get get an other message? Leave a comment and I'll come back to you.

Related Posts by Categories

Comments

11 Responses to "Running JMeter tests from behind a proxy server"

ab said... May 8, 2010 at 2:07 PM

We should thank you for giving such a wonderful blog. Your site happens to be not only informative but also very imaginative too. We find a limited number of experts who can think to write technical articles that creatively. All of us are on the lookout for information on something like this. I Myself have gone through several blogs to build up on knowledge about this.We look forward to the next posts !!

Webmaster Forum

Software Donload

Anonymous said... June 16, 2011 at 4:41 PM

Hello,

I am new to JMeter and I have the following error message

The WSDL was not valid, please double check the url.
org.apache.jmeter.protocol.http.util.WSDLException:soap.amazon.com

Any help will be appreciated.
Cheers

MLM Software India said... September 5, 2011 at 10:06 AM

Wow! very nice information. i was searching article like this.

Thanks

http://mlmdevelopers.com/products/mlm-software/mlm-software-beta/features.html

Rajesh said... January 5, 2012 at 5:20 AM

Error 4: The WSDL was not valid, please double
check the url. org.apache.jmeter.protocol.http.util.WSDLException: Connection refused: connect.

I tested for http for other application, it working fine there, but with jmeter i got error like above.

Anonymous said... March 22, 2012 at 2:36 PM

Thank you a lot! No such really valuable infomation was found in the JMeter's manual.

СПАСИБО!

Dzmitry said... January 27, 2013 at 9:02 AM

Thanks your for article!
I think that another solution of how to work with enterprise firewall is to use cloud-testing services, like http://blazemeter.com that is based on JMeter.
What do you think about it?

Madan said... January 31, 2013 at 7:52 AM

Kudos a lot for putting this useful info. We could not find this any where. Thanks for saving our time & effort

-Madan

TestWithUs said... May 7, 2013 at 5:52 AM

SWIFT Interview questions on

http://testwithus.blogspot.in/p/swift.htm

For selenium solution visit
http://testwithus.blogspot.in/p/blog-page.html


For QTP interview questions

http://testwithus.blogspot.in/p/qtp-questions.html


www.searchyourpolicy.com




star09 said... May 27, 2013 at 2:02 PM

this is very useful tool for electronics
LS Industrial Systems

Thomas Brayden said... July 23, 2013 at 11:13 PM

I am new to JMeter. Presently, I am still going through the JMeter's tutorials & familiarizing myself with the functions of JMeter. However, I am stuck with a really nasty problem & as an intern in the company, I am expected to come up with a solution myself. If you have been interested just click essayhogwarts.com/custom-essay.

Innovapath said... August 2, 2013 at 2:01 AM

Excellent Post. Also visit http://whiteboxqa.com/#performance.php

Post a Comment

Recent Articles

Top Commenters

Recent Comments

Books