Gatling is a highly capable load testing tool. It is designed for ease of use, maintainability and high performance. As this one-liner explanation doesn’t explain the whole concept, please visit this nice presentation: why should we use Gatling and what’s it has for us here. Well, I’ll take you through how we can implement Gatling in a project which uses maven builds.
So, We need to create a maven module/sub-project or a stand-alone maven project for Gatling with a meaningful name e.g. gatling-simulations or gatling-tests etc. So, you may have two cases here first you are implementing a gatling-simulator in a maven project where you’ll make gatling-test as a module of this project, second is when you can make a new Maven Gatling-Simulator standalone. Both cases are almost same just the directory structure may differ. For example:
The approach is exactly same, as both are maven projects. So, let’s start.
Steps of Setup:
-
-
-
- Create a maven project with a meaningful name e.g. Gatling-test, Gatling-simulations, load-test etc.
- Add src/test/resources for resources and src/test/scala for Simulator classes.
- Your pom.xml should look something like:
-
- Then gatling.conf must be there:
-
-
- Then design your simulator in scala:
-
-
-
Now your setup is ready to run. The maven command to run your Gatling setup is completely dependent upon the configurations given in your plugin in the build.
Mine is like:
or
for Standalone setup.
or
for built-in setup.
Please comment your doubts or queries and share if you liked the post.
Reblogged this on Coding, Unix & Other Hackeresque Things.