6. Add Assertions to Load Tests

Applies to ReadyAPI 3.54, last modified on September 23, 2024

Assertions are validation rules applied to test results that check how your target web service performs during a test run.

Now, we will create an assertion that will check that the average simulation time of a single test step does not exceed some time limit:

  1. Expand the test case and click the Response element of the test step you want to assert. The Request editor will be displayed.

    API load testing with ReadyAPI: The Response Element

    Click the image to enlarge it.

  2. In the Assertions section of the Request inspector, click :

    API load testing with ReadyAPI: Add Assertion
  3. In the subsequent Add Assertion dialog, select the Time Taken statistics and the Median metric using drop-down lists:

    API load testing with ReadyAPI: Add Assertion Dialog
  4. Configure other assertion parameters:

    • In the Maximum edit box, enter the maximum time the test step execution can take on average.

    • In the Tolerance section, set the maximum number of times the assertion should trigger before logging an error.

  5. Click OK. ReadyAPI will add the assertion to your load test.

    API load testing with ReadyAPI: Added Assertion

    Click the image to enlarge it.

  6. Run the test again. If the responses take too long, ReadyAPI will report errors. View the assertion errors in the Global Metrics graph and in the Test Step Metrics table:

    API load testing with ReadyAPI: Assertion Failures

Prev     Next

See Also

About Assertions
Statistics and Metrics Reference

Highlight search results