run a test from IDE using App trait

Hi Guys,

I updated my project to use 2.1.0-SNAPSHOT version because I needed the latest websocket bug fix. Apart from some scala 2.11.4 issues and gatling api changes everything is ok now. I can run my test using sbt gatling:test.
But in the stable version I could use something like this to start the test from intellij:

object CometDGatlingTest extends App {
val gatlingPropertyBuilder = new GatlingPropertiesBuilder

class CometDGatlingTest extends Simulation with Logging {


In the new snapshot version I cannot do this as the api has changed.
What is the best practice now to start a test programmatically with a specific test class?


Hi Krisztian,

This method was removed a bit too fast. We were aware of it and planning to bring in back today, we just didn’t expect someone to be impacted so fast.

We’re re-introducing it temporarily to ease maven archetype based projects, but it will be definitively dropped in 2.2.
See deprecation message for migration.



Is it possible that something else has been changed as well?

Exception in thread “main” java.nio.file.NoSuchFileException: ./target/test-classes
at sun.nio.fs.UnixException.translateToIOException(
at sun.nio.fs.UnixException.rethrowAsIOException(
at sun.nio.fs.UnixException.rethrowAsIOException(
at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(
at java.nio.file.Files.newDirectoryStream(

I believe that not just the fromMap method changed which is responsible for being able to run the test like an App.
I saw the same exception when I wanted to use the following:
new Gatling(, simulationClass).start

But it was OK in the stable version.



This change comes from the refactoring I made to allow Gatling to upgrade to Scala 2.11.
Gatling search the compiled classes in target/test-classes by default, but in your case, even if this folder does exist, the path is incorrect.
You can, if you want, have a look at how the Maven Archetype fixes this :

But it’ll be faster to simply copy those classes from the archetype into your project and run the Engine class :wink:

Side note :
Since you’re using 2.1 snapshots, you may like the fact that the mute mode (not asking for simulationID nor run description) works everywhere, and not only for the SBT plugin.
If you activate it (gatlingPropertyBuilder.mute()), your simulation would now run right away, without asking for inputs. In short, faster development cycles for free :slight_smile:



Hi Pierre,

I remembered that there was an Engine and a IDEPathHelper long time ago and I used to use them from gatling 1.5. But since I updated to gatling 2 I couldn’t find them.
Thanks the update.


It has always been there :wink:
But when we migrated Gatling from Maven to SBT, the projects necessarily relying on Maven (e.g. our Maven plugin and archetype) were moved to their own repositories, and unified in 2.1 in single gatling-maven repository.

Thx the help anyway.

@Stephane you can remove the fromMap method as it is not used.


I realized a bit too late that removing ‘fromMap’ was a really bad idea…
On master, there is now ‘fromMap’ and ‘fromArgs’ to start Gatling, and the older ‘runGatling’ is now deprecated.