0

I am working on Grinder tool for load testing. In my script, I have a URL which follows multiple redirects and finally lands on a particular URL. I want to get the final URL of a request after multiple redirects using Jython script for Grinder. This is what I am doing

test1 = Test(1, "Request resource")
request1 = HTTPRequest()
test1.record(request1)

class TestRunner:
  def __call__(self):
    result = request1.GET("https://internal.autodesk360beta.com/")
    result2 = result.getEffectiveURI().toString()
    print result2

I am getting the final URI as the same one instead of a long final URL that looks something like this https://accounts.autodesk.com/LogOn?ReturnUrl=%2fauthorize%3f.. and so on.. Any help would be appreciated.

Travis Bear
  • 13,039
  • 7
  • 42
  • 51
kirti
  • 40
  • 5

1 Answers1

0

By default, Grinder follows redirects automatically. However, you can disable this behavior and then explicitly follow each redirect in your jython code. With this approach you'll have access to each URL in the redirect chain.

Travis Bear
  • 13,039
  • 7
  • 42
  • 51