StresStimulus automatically detects HTTP errors by checking response status codes of the emulated traffic. All responses with the status code of 400 and above are listed as errors in the Error Details report. However, this level of verification is insufficient to track down application-specific errors and exceptions. For this purpose, StresStimulus supports Validators that allow comparing responses against some expected values. Also, validators take precedence over the HTTP errors to make error reporting as granular as necessary. For example, one custom validator will recognize a database error message in response with status code 500, and another one will recognize a web server error message in response with status code 500. As a result, 500 responses with a database error, 500 responses with Web server error and 500 responses with other types of errors will be reported as three different error types.

     

    A Validator is a rule of comparing a server’s response with a text pattern. In the case of a mismatch, a custom error is raised. Custom errors are reflected in test results. You can create validators for a single response (local), or all responses (global). To create a new validator:

    1. Go to the Validators node on the Workflow Tree

    2. Click Create a new Validator. A new validator dialog will appear.

    3. Type the text or regular expression to search for in the response. If it's a regular expression, then set the Is text a regular expression? to Yes.

    Icon

    Note: The text to search can include extractors. For instance: id={{item_id}}

    4. Change the Fail If setting if you want an error to occur if the text is found. The value Found is not available for global validators. The default is Not Found.

    5. The Scope setting allows changing the validator from local to global.

    6. Change the Action if Failed setting to the following:

        • Abort Iteration to stop the current iteration, mark it as failed, and start a new one.
        • Abort VU to stop the current iteration, mark it as failed, don't start any more iterations by this VU.
        • Continue to continue the current iteration.

           7. After that, complete the Description field with a meaningful definition of the error. Set this setting to Abort VU to stop the current VU from executing any more requests.

    8. Click Add Validator when finished.

     

    Icon

    Note: Validator's Description property is used to identify custom errors on StresStimulus test results. If Description is empty, then the Text to search property is used to identify the custom error.

    Alternatively, you can create a validator for a recorded session by opening its session inspector and clicking Create Validator (a) on the toolbar.

    Another convenient way of creating validators is when comparing two sessions. In the Compare Sessions Inspector, select the Response tab and on the toolbar of the replayed window on the right, click Create Validator (b).

     

    Icon

    Note: You can highlight text in the replayed response before clicking the Create Validator button, and this text will automatically populate the Text to search field in the Create Validator dialog.

     

     

     


       

     

    • No labels