While running performance test, JMeter allows maximum 5 redirects by default. However, if your system demands more than 5 redirects, it may result in JMeter exceeded maximum number of redirects error. In this post, we have listed down steps to overcome this error.
Actual error in JMeter:
Response code: “Non HTTP response code: java.io.IOException”
Response message: “Non HTTP response message: Exceeded maximum number of redirects: 5”
This error is noticed because JMeter allows maximum 5 redirects by default and your system may be using more than 5 redirects. You need to increase this count to more than 5 in jmeter.properties file. Follow below steps to achieve this.
- Navigate to /bin directory of your JMeter installation.
- Locate jmeter.properties file and open it in any editor.
- Search for “httpsampler.max_redirects” property in opened file.
- Uncomment the above property by removing # before it.
- Change to value to more than 5 Eg. 20.
- Save the file and restart JMeter.
If the above method doesn’t solve this error, check below items in your JMeter script.
- Try disabling follow redirects, and see what the first page says in the Tree View listener.
- Make sure you have HTTP Cookie Manager added and is properly configured.
After performing above simple steps, you should be able to get rid of JMeter Exceeded Maximum Number of Redirects Error successfully. Let us know how it goes for you in comments.