Thursday, June 21, 2012

JMeter - Overcome/Remove Maximum number of redirects


By Default JMeter performs maximum of 5 redirects, but whenever if your application performs more than 5 redirects JMeter will throw below error during script execution -


Error in JMeter:

Response code: Non HTTP response code: java.io.IOException
Response message: Non HTTP response message: Exceeded maximum number of
redirects: 5


To overcome the error we have to change property value of httpsampler.max_redirects in jmeter.properties file in /bin directory, do the following steps -

1. Change the value of the property to 20
2. Remove # before httpsampler.max_redirects
3. Save the file
4. Restart JMeter

Property value will be as below after the change -

# Maximum redirects to follow in a single sequence (default 5)
httpsampler.max_redirects=20

That's all now JMeter will be able to redirect up to 20 auto redirects.

Happy Learning!!!