Running the Gatling Test Script

Run the Gatling test script using the Gatling recorder.

In the previous lesson, we learned how to record and capture scripts using a Gatling recorder. In this lesson, we will learn how to run the captured Gatling test script.

Running the Gatling test script

By default, the test scripts will be stored at <GATLING_HOME>/user-files/simulations.

GATLING_HOME represents the location where we extracted the Gatling libraries and executables.

Mac / Linux

cd <GATLING_HOME>/bin
bash gatling.sh

Windows

cd <GATLING_HOME>\bin
gatling.bat

Once we execute the above command, we should see something like this:

GATLING_HOME is set to ....../gatling-charts-highcharts-bundle-3.3.1
Choose a simulation number:
     [0] RecordedSimulation
     [1] computerdatabase.BasicSimulation
     [2] computerdatabase.advanced.AdvancedSimulationStep01
     [3] computerdatabase.advanced.AdvancedSimulationStep02
     [4] computerdatabase.advanced.AdvancedSimulationStep03
     [5] computerdatabase.advanced.AdvancedSimulationStep04
     [6] computerdatabase.advanced.AdvancedSimulationStep05

RecordedSimulation is the test script that was generated using a Gatling recorder. computerdatabase.advanced... are the sample test scripts that Gatling provides.

Once the above prompt appears, we need to enter the number corresponding to the simulation that we want to run. In our case, we will run RecordedSimulation by entering 0 and hit ENTER.

Next, RecordedSimulation will start the execution and show the output on the console like below:

Get hands-on with 1400+ tech skills courses.