Skip to content

Test Generator Follows 1 Redirect; When Calls Have 2 or More Redirect, Cannot Use GUI to Correlate #631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nex-juantrejo opened this issue Apr 8, 2025 · 0 comments
Labels
bug Something isn't working needs-triage

Comments

@nex-juantrejo
Copy link

Describe the bug

For HTTP calls which have more than one redirection in chain, correlation is not possible: Test Generator shows all the filtered traffic, but generated script creates code for the second redirected url. First redirected call is ignored as expected.

E.g. a call chain with 2 redirects (typical for logins such as oAuth via web navigation)
Call 1: HTTP 302|301|308... - Header A, Body A <- Scripted
Call 2: HTTP 302|301|308... - Header B, Body B <- Not on Script (ignored as redirection)
Call 3: HTTP 2XX. <- Scripted

The Validator executes the generated script following all redirections.

Call 1: HTTP 3XX
Call 2 (not from script, following redirection): HTTP 3XX
Call 3 (not from script, following redirection): HTTP 3XX
Call 3 (from Script):

GUI doesn't have an option to configure the redirections Test Generator or Validator should follow, causing a discrepancy. If a correlation is needed for Call 2, it will not be added to the script if the match and/or replacement occur on it, since it doesn't exist on the script.

Workaround is to manually modify the exported script to add "maxRedirects: 1" in test options, which Validator takes to run the test, however, correlations where extraction and/or match is for Call 2, which is not scripted should be done manually after exporting the script.

This prevents users from leveraging GUI to correlate, leaving to manual rework.

These redirections are common for login / auth flows.

Image Image Image

Steps to reproduce the problem

  1. Record web navigation which includes a call with more than one redirection chained. (e.g. a login with oAuth).
  2. Create a Test Generator from the Recording.
  3. Click on "Script" tab and observe the first redirected call is not on the script.
  4. Click on "Validate" to execute the Validator.
  5. Observe in the traffic generated by the Validator execution, that the 2nd redirected call is duplicate: one by the validator following all redirections, another by the script.
  6. Create a correlation rule, using the URI of first call in the chain as filter, create a match for a value returned by the 1st redirected call in the chain. Click on "back" to save the correlation.
  7. Click on "Script" tab and observe code for the recently created correlation rule does not exist, since it applies to a call not on the script.

Expected behavior

Test Generator and Validator consider a specified number of redirections both to create the script and to execute it. Correlation rules consider matches for implicit redirected calls.

Actual behavior

Test Generator considers 1 redirection when creating script code, Validator follows all redirections, Correlation rules do not consider redirections, but skip creating code for matches on calls not scripted.

Grafana k6 Studio version

1.1.0

OS

mac 15.3.2

@nex-juantrejo nex-juantrejo added bug Something isn't working needs-triage labels Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant