3

I'm using the HTTP2 plugin for JMeter from Blazemeter and I'm unable to make the HTTP2 request follow the redirects. I tried checking the "Follow Redirects" box and "Synchronized Request" and it doesn't work.

I get the Response code: 301 & Response message: HTTP/2.0 301 Moved Permanently and the location where it should redirect in the Response headers => "location".

I am trying to make a HTTP2 request to "www.aoro.ro" (GET https://www.aoro.ro/) which should redirect me to "https://www.notino.ro/" but does not follow the location it gets from the Reponse headers: HTTP/2.0 301 Moved Permanently location: https://www.notino.ro/ and I'm stuck with this response and cannot use assertions based on the redirects.

I also tried to use "HTTP Header Manager" and send all the headers from the browser. I read that HTTP2 version of HTTP protocol is asynchronous and this may interfere with the redirect.

Do you know anything regarding the Redirecting on JMeter with HTTP2 plugin?

Nabres BR
  • 78
  • 9

2 Answers2

2

I confirm it's a bug of HTTP2 Request that I reported here (as there is no issue reporting in their github):

What you can do is handle it yourself using Regular Expression Extractor:

REE Config

And add it like this:

Test Plan

Then use ${REDIRECT} in path field of another HTTP2 Request:

Reuse variable

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116
  • Where's the bug report for this? Not following redirect doesn't seem like a bug. I certainly never want to auto follow redirect, especially in a controlled testing scenario like jmeter. – Joakim Erdfelt Nov 07 '18 at 01:29
  • it’s a bug since there is a checkbox saying follow redirect while it’s not happening. Compare to core http request. The github repo has no issue report, so I reported it on jmeter-plugins google group. – UBIK LOAD PACK Nov 07 '18 at 06:34
  • Thanks for the solution and bug reporting. Tried to use regex on response headers and manually implement the "redirect" with the location and it works fine but this is a good termporary solution for a short JMeter script. I want to switch from HTTP1.1 to HTTP2 a complete scenario (login-search-add2basket etc) and manually redirect every request would put high load on the JVM. So hopefully your report on jmeter-plugins google group will be noticed @UBIKLOADPACK – Nabres BR Nov 07 '18 at 07:43
  • Found out why it didn't Follow redirects, see below. @UBIKLOADPACK – Nabres BR Dec 06 '18 at 11:58
2

After a deeper research about the blazemeter.jmeter.http2.sampler I found out that the HTTP2 sampler request does not have the followRedirects() method implemented in the HTTP2Request.class file.

To get to this file you have to extract files from jmeter-bzm-http2-1.4.jar file from lib.ext folder and the .class files will be in com\blazemeter\jmeter\http2\sampler folder. After this step you have to decompile HTTP2Request.class file (did it using the online tool : https://devtoolzone.com/decompiler/java) and open it using Notepad++ / Sublime or any other program to see the script.

So until a new version of this plugin is released, Follow Redirects/ Autoredirect will not work (no implementation of it)

Nabres BR
  • 78
  • 9