Assertions

Learn about assertions in this lesson.

In the previous lesson, we learned about the different ways to inject users into the simulation. In this lesson, we will learn how to validate the metrics of the responses.

What are assertions?

Assertions are used to verify the global statistics like the total number of successful requests, the total number of failing requests, total response mean time, maximum of total response times, minimum of total response times, etc.

Defining scope

Gatling allows us to define the scope and apply assertions to that scope. For example, it can be applied to:

  • global – uses the statistics calculated for all the requests that were hit during the entire simulation.
  • forAll – uses the statistics calculated for an individual request.
  • details(path) – uses the statistics calculated for requests having the given path.

Statistics

We can call any of the following statistics on the above scopes:

  • responseTime – fetches the response
...