How to Execute particular simulations using maven goals

7,479 views
Skip to first unread message

BeemiReddy RajaSekhar

unread,
Dec 23, 2016, 11:42:00 PM12/23/16
to Gatling User Group
Hi folks,

i am using gatling version 2.2.3, i have a bunch of Simulation class's in one package Ex:com.company.name.loadtests

below is my gatling maven plugin configuration

<plugin>
    <groupId>io.gatling</groupId>
    <artifactId>gatling-maven-plugin</artifactId>
    <version>${gatling-plugin.version}</version>
    <!-- configuration -->
    <configuration>
        <configFolder>src/test/resources</configFolder>
        <dataFolder>src/test/resources/data</dataFolder>
        <resultsFolder>target/gatling/results</resultsFolder>
        <runMultipleSimulations>false</runMultipleSimulations>
        <simulationsFolder>src/test/scala/com/company/name/loadtests</simulationsFolder>
        <!--    <noReports>false</noReports> -->
        <!--   <reportsOnly>directoryName</reportsOnly> -->
        <!--   <simulationClass>foo.Bar</simulationClass> -->
        <!--   <jvmArgs> -->
        <!--     <jvmArg>-DmyExtraParam=foo</jvmArg> -->
        <!--   </jvmArgs> -->
        <!--    <fork>true</fork> -->
        <!--    <propagateSystemProperties>true</propagateSystemProperties> -->
        <!--   <failOnError>true</failOnError> -->
    </configuration>
    <executions>
        <execution>
            <id>Test1</id>
            <goals>
                <goal>integration-test</goal>
            </goals>
            <configuration>
                <simulationClass>com.company.name.loadtests.CourierCreationTest</simulationClass>
            </configuration>
        </execution>
    </executions>
</plugin>


  1. if i use maven goal as
    $mvn gatling:integration-test

    i got the below error 
    1. Gatling failed. More than 1 simulation to run, need to specify one, or enable runMultipleSimulations -> [Help 1]

  2. i need to execute those class on CI env so please guide me how to Run single Simulation class with Maven plugin?
  3. How to execute multiple Simulation class's at same time ?
Thank you 

Siegfried Goeschl

unread,
Dec 24, 2016, 11:56:42 AM12/24/16
to Gatling User Group
ad 2) mvn -Dgatling.simulationClass=com/company/name/loadtest/${Your Simulation Class Without Extension} will do the trick executing a single test on the command line

ad 3) Never did it but it is described here: http://gatling.io/docs/2.2.2/extensions/maven_plugin.html - you need to decide it you rely on the Maven life cycle or trigger the tests using 2)


BeemiReddy RajaSekhar

unread,
Dec 29, 2016, 1:33:00 PM12/29/16
to Gatling User Group
Thanks for the reply Siegfried,

yes i have tried that as well 
$ mvn clean gatling:integration-test -Dgatling.simulationClass={myClassName}

when i run this maven goal still asking me Choose a simulation number: again 

  • all my simulation class's in one folder including one Page Object Class (com.companyname.loadtest)
  • in my pom here is the plugin configuration 
    • <build>
      <plugins>
      <!--<plugin>-->
      <!--<groupId>net.alchim31.maven</groupId>-->
      <!--<artifactId>scala-maven-plugin</artifactId>-->
      <!--<version>${scala-maven-plugin.version}</version>-->
      <!--</plugin>-->
    •         <plugin>
      <groupId>io.gatling</groupId>
      <artifactId>gatling-maven-plugin</artifactId>
      <version>${gatling-plugin.version}</version>
    •         </plugin>
      </plugins>
      </build>


  • i want to execute one simulation class for same package ?
Thank you
Raj

hari harmalkar

unread,
Jul 18, 2019, 1:38:20 AM7/18/19
to Gatling User Group
I have following plugin in pom.xml

<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>2.1.6</version>
</plugin>

Use following command to execute a single simulation :

mvn -Dgatling.simulationClass=com.company.name.Loadtests  gatling:execute

If using com/company/name/Loadtests it asks to Choose a simulation number

Siegfried Goeschl

unread,
Jul 18, 2019, 3:16:49 AM7/18/19
to Gatling User Group
Hi folks,

it is hard to know what's wrong with your given setup (different Gatling & Maven plugin versions) - you can have a look at one of my pet project where selecting the tests using system properties does work : https://github.com/sgoeschl/gatling-blueprint-project

Thanks in advance, 

Siegfried Goeschl

Reply all
Reply to author
Forward
0 new messages