3

I wish to test the URL at the end of a series of redirects. With Automatically follow redirects on, this appears not to be possible.

I have a number of redirects when my Postman request is made and I would like them to be executed automatically, so I am not turning off Automatically follow redirects, but my test needs to check the final URL of the request:

pm.test("URL contains final addr", function () {
    pm.expect(pm.response.url).to.include("/Customer.aspx");
});

This question is very similar to this post however I need to still get the URL with redirection turned on.

How should I be retrieving the true, final URL after a number of redirects?

Matt W
  • 11,753
  • 25
  • 118
  • 215

0 Answers0