NoClassDefFound / NoSuchElementException

Hello all,

I have a problem with properly setting up tests with Gatling. I tried to follow what is in quickstart but I keep getting NoSuchElementException being thrown a me
`

class Simple extends Simulation with FlatSpecLike {
val httpConf = http

it should “should just work” in {
val scn = scenario(“just work”).
exec(
http(“basic test”).
get("/")
)

setUp(
scn.inject(atOnceUsers(1))
).protocols(httpConf)
}
}

`

and exception stack is

`

[info] Cause: java.lang.NullPointerException:
[info] at io.gatling.http.config.HttpProtocol$.(HttpProtocol.scala:48)
[info] at io.gatling.http.config.HttpProtocol$.(HttpProtocol.scala)
[info] at io.gatling.http.config.HttpProtocolBuilder$.(HttpProtocolBuilder.scala:38)
[info] at io.gatling.http.config.HttpProtocolBuilder$.(HttpProtocolBuilder.scala)
[info] at io.gatling.http.Predef$.http(Predef.scala:37)
[info] at com.soda.models.prediction.DockerPredictionModelLoadSuite.(DockerPredictionModelLoadSuite.scala:32)
[info] at com.soda.models.prediction.InsultModelLoadSuite.(DockerPredictionModelLoadSuite.scala:47)
[info] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[info] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[info] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

`

Thank you for all your help

No, you never read in the quickstart that you could use Gatling inside ScalaTest specs. And no, that’s not possible.
But Gatling 2.2 will have a very experimental FunSpec. See here for an example.

If I try to similiar code from REPL it’s the same.

You CAN’T use Gatling in FlatSpecLike!
You CAN’T launch Gatling Simulations directly.

Gatling Simulations are definitions that are built and load by the Gatling engine.