Gatling is a load testing tool that comes with support of the HTTP protocol – which makes it a really good choice for load testing any HTTP server.
- Install Scala plugin into Intelij
- Execute the following command in terminal:
mvn archetype:generate
- When prompted to choose a number or filter, enter:
gatling
- Select the archetype:
io.gatling.highcharts:gatling-highcharts-maven-archetype (gatling-highcharts-maven-archetype)
-
Then when prompted to select the version, choose the latest version.
-
Enter a groupId, artifactId, version and package for the archetype and confirm the same.
-
Finish by importing the archetype into an IDE
Run the Recorder class from IDE. It will launch the Recorder GUI. Once it is launched, configure how requests and responses will be recorded in the GUI. Choose the following options:
- 8000 as listening port
- Follow Redirects? checked
- Automatic Referers? checked
- Black list first filter strategy selected
- ..css, ..js and .*.ico in the black list filters
To run the recorded simulation, add this to pom.xml:
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>2.2.4</version>
<executions>
<execution>
<phase>test</phase>
<goals><goal>execute</goal></goals>
<configuration>
<disableCompiler>true</disableCompiler>
</configuration>
</execution>
</executions>
</plugin>
Execute the following command in terminal:
mvn test
Open the index.html file