JMeter Exceeded Maximum Number of Redirects Error Solution
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.
Hi Maharshi
I tried all the above steps u mentioned by unchecked “Follow Redirect” checkboxes and again run my script but this time it does not shows response data in View result graph.
So, can you please tell me where i did wrong or how i will solve this problem
Hi,
Before executing script you should add cookie Manager while getting redirection error.
I have applied before executing for me working fine.
Thanks..
Hii Mahrashi,
I had already set max redirect:20 but still i getting an error. can you suggest me any way
I am also getting this type of error after changing the value can anyone help ??
Option 1: Try to remove Host attribute in HTTP Header Manager for that request and replay.
Option 2: Set Cookie and Cache Manager
Option 3: Set Redirects limit in Jmeter.properties file.
This helped me a lot. Actually i was facing the similar problem and reading this article i understood that i didn’t add ‘HTTP Cookie Manager’ and 100% error for each of the scripts was happening. After adding ‘HTTP Cookie Manager’ with my test plan, the problem is solved. Thanks a lot for sharing this information.
Regards,
Md. Ashrafuzzaman