Handling Unexpected Redirects

Applies to LoadComplete 4.97, last modified on May 20, 2019


During traffic recording, LoadComplete captures the requests sent to your tested web server and the responses the tested web server returns. When you play back the recorded traffic, LoadComplete sends the recorded requests, captures the responses the server returns and compares them against the recorded responses to verify that the server acts as expected. If a response your tested web server returns differs from the recorded one, LoadComplete reports a warning.

It is quite possible the behavior of your tested web server may change after your scenarios is recorded. For example, some resources may be moved to a new location and redirects can be created for them. A redirect is a server response with code 3xx, for example, 302 Moved Permanently or 307 Temporary Redirect. Usually, such a response contains the URL of the resource’s new location.

When you simulate your recorded scenarios, the requests that access resources using their old locations will get a 3xx Redirection response from the server instead of the expected response. LoadComplete detects such unexpected redirects (the ones that did not take place during the traffic recording). It captures the new resource location from the redirection response and simulates a request to the new location automatically. It will also capture the successive response (or responses).

Simulating traffic with LoadComplete: Detected redirects

Click the image to enlarge it.

If a request is redirected several times (a redirect chain), LoadComplete will detect up to 10 redirection responses. If a request is redirected more than 10 times, LoadComplete will post an error to the test log.

LoadComplete will process the successive server response in the same way it processes regular responses. When validating the server response code, LoadComplete will compare the recorded code with the code of the successive response. If your recorded response includes any data selectors or validators, LoadComplete will apply them to the successive response rather than to the initial redirection response:

Simulating traffic with LoadComplete: Processing successive server responses

Click the image to enlarge it.

Reporting Unexpected Redirects

By default, LoadComplete posts a message about the unexpected redirects it handles during the test run to the Details test log. You can also command it to report such unexpected redirects as warnings or errors, or to ignore them at all. To do this, configure the Simulating > Event Handling > Auto redirect option:

Simulating traffic with LoadComplete: Handling redirects during simulation

Click the image to enlarge it.

See Also

Running Load Tests
Starting a Test
Verifying Server Responses
Setting Expected Response Codes
Event Handling Options

Highlight search results