Gatling | Maven Setup.

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.

Pasted image at 2017_11_27 04_17 PM

Written by 

Yashpal, is a software consultant at Knoldus Inc, having more than 2.5 years of working experience. Yash is familiar with programming languages such as Java and Scala and he is currently working on reactive technologies like Scala, Lagom, Akka, Spark, and Kafka. Yash is also a proactive learner of new technologies and languages. His hobbies include playing chess, Table Tennis and basketball, watching Hollywood movies & series and he also loves listening to good music and singing Indian Vocal.

2 thoughts on “Gatling | Maven Setup.

Leave a Reply

%d bloggers like this: