How to externalize simulation class and folder

103 views
Skip to first unread message

Kirankumar Siripireddy

unread,
Jun 19, 2018, 6:30:10 AM6/19/18
to Gatling User Group
Hi Team,

I want to define simulation class and simulation folder in test.properties file and read them in pom.xml. I have gone though some articles or solutions and tried everthing but nothing helped. every time i end up with Multiple simuation found error.

I have defined properties as below

test.simulationClass=com.test.helix.recordings.CreateUserAccount.CreateUserAccount
test.simulationsFolder=/src/test/scala

And in pom.xml I am reading it as below


<?xml version="1.0" encoding="UTF-8"?>
<modelVersion>4.0.0</modelVersion>
<groupId>io.gatling.highcharts</groupId>
<artifactId>gatling-highcharts-maven-archetype</artifactId>
<version>2.3.1</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<scala.version>2.12.4</scala.version>
<encoding>UTF-8</encoding>
<gatling.version>2.3.1</gatling.version>
<scala-maven-plugin.version>3.2.2</scala-maven-plugin.version>
</properties>

<build>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/src/test/resources/test.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>2.2.4</version>
<configuration>
<disableCompiler>true</disableCompiler>
                                         <simulationsFolder>${simulationsFolder}</simulationsFolder>
<simulationClass>${simulationClass}</simulationClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

Note: I have pasted only necessary snippet.

Every time when in run "mvn gatling:execute" i am getting below error

[ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:2.2.4:execute (default-cli) on project gatling-highcharts-maven-archetype: Gatling failed. More than 1 simulation to run, nee
d to specify one, or enable runMultipleSimulations -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

Can someone help me out.

Thanks,
Karthik P.


Ethen

unread,
Jun 22, 2018, 4:50:46 AM6/22/18
to Gatling User Group
<runMultipleSimulations>true</runMultipleSimulations>
add it to your configuration

more info will be find in



在 2018年6月19日星期二 UTC+8下午6:30:10,Kirankumar Siripireddy写道:
Reply all
Reply to author
Forward
0 new messages