Interview Questions

What happens with redirects when asserting HTTP responses?

Apache JMeter FAQ


(Continued from previous question...)

What happens with redirects when asserting HTTP responses?

Answer:Assertions aren't smart enough to do the right thing with redirected requests - currently the 302 response would be asserted against. You can get around this by recording your test plans and leaving "follow redirects" off.

Alternatively, the latest JMeter release (after 1.9.1) has an option to allow the redirects to be handled by the Java libary routines. Earlier versions of Java did not support redirects properly, but if you want to try, just define the following JMeter property:

HTTPSampler.delegateRedirects=true

JMeter will then not see the redirects at all.

(Continued on next question...)

Other Interview Questions