Running the Gatling Test Script

Learn how to run the Gatling test script locally.

In our previous lesson, we learned how to write our first Gatling test script. In this lesson, we will learn how to run the test script and override the configuration.

Running from terminal

Run the following command to run the Gatling test script.

./gradlew clean gatlingRun

By running the above command, all the Gatling simulation scripts will be run.

We can also run an individual simulation script using the following command:

./gradlew clean gatlingRun-SampleSimulation

Note:

  • SampleSimulation needs to be replaced with a fully qualified class name of the simulation script.
  • There is a - between gatlingRun and simulation class name.
  • If there are multiple simulation files, each file will run sequentially. Each of the simulations will have its own logs and HTML report that can be found at ${project.dir}/build/reports/gatling/<simulation-name>.

Sample console output

Below is a sample output of the execution:

Get hands-on with 1200+ tech skills courses.