Now, we are familiar with the framework code structure. In the next lesson, we will learn to build, run, and experiment with the downloaded sample simulation code.

Building the framework code

Navigate to the project root folder and run the following commands:

./gradlew clean build -x test

Running a single simulation file

Navigate to the project and run the following command:

./gradlew clean gatlingRun-<fully-qualified-simulation-file>

Example:

./gradlew clean gatlingRun-simulations.SampleSimulation

Running all the simulation files

Go to the project root to run the command.

./gradlew clean gatlingRun

This will run all the simulation files present under src/test/scala/simulations. This configuration that includes all simulation files under the simulations package is present on line 32 of build.gradle.

All the simulation files will be run one after the other.

Generated reports path

At the end of the run, we should see the path of the generated report that looks like this:

build/reports/gatling/<simulation-file>-<timestamp>/index.html

If we run multiple simulations, multiple folders will be present under build/reports/gatling.

Sample report

We can open the HTML report in any browser.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy