Automatic Authentication

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

About

Sometimes, during traffic simulation, your tested web server may decline a simulated request. Instead of the expected response, it may return a 401 Unauthorized response. This indicates that the request tried to access a restricted resource, but no appropriate credentials were specified.

This can happen, for example, if:

  • The behavior of your tested web server has changed. The resources, access to which used to be anonymous, are now protected and require authentication.

  • You provided credentials before you started recording your scenarios. The requests that send the authentication data to your tested web server were not recorded. (That is why we recommend that you always start recording scenarios from launching your web browser and clearing the browser cache or activating its private mode. See Recording - Tips.)

LoadComplete can handle these unexpected 401 Unauthorized responses automatically. All you need to do is to specify the needed credentials in the Authentication table of your project:

Authorization support in LoadComplete: Enter credentials

During simulation, if an unexpected 401 Unauthorized response is received, LoadComplete will detect this, generate an authentication request using the credentials specified in the Authentication table for the server, and send it to the tested server:

Authorization support in LoadComplete: Sending an automatic authentication request

Click the image to enlarge it.

LoadComplete will also capture the successive response the server will return after the authentication is complete. If your recorded response includes any data selectors or validations, LoadComplete will apply them to the successive response rather than to the unexpected 401 Unauthorized response:

Authorization support in LoadComplete: Processing server responses

Click the image to enlarge it.

Reporting Automatic Authentication Requests

By default, whenever LoadComplete detects an unexpected 401 Unauthorized response and sends an automatic authentication request, it posts a message about it to the Details test log. You can command LoadComplete to report automatic authentication as a warning or error, or to ignore such events at all. To do this, configure the Tools > Options > Simulating > Event Handling > Auto authorization option:

Simulating traffic with LoadComplete: Reporting automatic authentication requests

Click the image to enlarge it.

See Also

Setting Authentication Parameters
Recording - Tips
Setting Expected Response Codes
Event Handling Options

Highlight search results