Saturday, January 30, 2010

JMeter & Fiddler – PUT in JMETER 2.3 does not work either

JMeter and Fiddler are excellent tools by themselves. They are good enough on what they are wrote for. In one of my project we were using JMeter to script out load test. Idea was to perform load test on our RESTful service.

Simple ah, but certain load scripts were just failing but the same time, it works from fiddler. It was necessary to see why it works in fiddler but the same construct in the JMeter fails. Thought, if I could see what is being sent by the JMeter and compare against the Fiddler, I can figure out what is wrong. So if I could proxy it through fidder I can see what is happening and figure out. Interestingly, JMeter itself can be configured to act like Proxy but did not want to explore a lot. So I did below thing. to make JMeter to send the request through Fiddler using proxy configuration.

Run the jmeter.bat/jmeter file from a command line with the following parameters:

-H [proxy server hostname or ip address]
-P [proxy server port]
-N [nonproxy hosts] (e.g. *|localhost)
-u [username for proxy authentication - if required]
-a [password for proxy authentication - if required]

Example : jmeter –H -P 8888 -u username -a password -N localhost

Ok did that help to solve my original problem. Yes. We were using JMeter 2.3 RC3 version of JMeter and it had bug. If the request is “PUT” then tool does supply the HTTP Request body. Hence our scripts were sending empty body in the request. This I could figure from the Fiddler. Solution was to upgrade to latest version


Sree said...

Good One!! Thanks for the Info!!!