How to Execute particular simulations using maven goals

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

  2. `
    Gatling failed. More than 1 simulation to run, need to specify one, or enable runMultipleSimulations → [Help 1]

    `

  3. i need to execute those class on CI env so please guide me how to Run single Simulation class with Maven plugin?

  4. How to execute multiple Simulation class’s at same time ?
    Thank you

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)

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 have following plugin in pom.xml

io.gatling gatling-maven-plugin 2.1.6

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

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