Recorded Simulation does not compile

I have just installed gatling 1.5.6 and tried using the recorder, upon running the generated code I have encountered an error. See code and error below… Do I need to install anything before using gatling?

please see the code below:

import scala.concurrent.duration._

import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import io.gatling.http.HeaderNames

class RecordedSimulation extends Simulation {

val httpConf = httpConfig
.baseURL(“http://10.23.22.186:8080”)
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”)
.acceptEncodingHeader(“gzip, deflate”)
.acceptLanguageHeader(“en-US,en;q=0.5”)
.connection(“keep-alive”)
.userAgentHeader(“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0”)

val scn = scenario(“Scenario Name”)
.exec(http(“request_1”)
.get("/")
.queryParam(""“login”"", “”“user1"”")
)

setUp(scn.users(1).protocolConfig(httpConf))
}

Here is the error encountered:

10:46:27.615 [ERROR] c.e.e.g.a.ZincCompiler$ - /home/genetan/Downloads/gatling-charts-highcharts-1.5.6/user-files/simulations/RecordedSimulation.scala:3: object gatling is not a member of package io
10:46:27.619 [ERROR] c.e.e.g.a.ZincCompiler$ - import io.gatling.core.Predef._
10:46:27.620 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
10:46:33.173 [ERROR] c.e.e.g.a.ZincCompiler$ - /home/genetan/Downloads/gatling-charts-highcharts-1.5.6/user-files/simulations/sample/RecordedSimulation.scala:5: object gatling is not a member of package io
10:46:33.174 [ERROR] c.e.e.g.a.ZincCompiler$ - import io.gatling.core.Predef._
10:46:33.174 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
10:46:33.246 [ERROR] c.e.e.g.a.ZincCompiler$ - two errors found
Exception in thread “main” Compilation failed
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:76)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:35)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:29)
at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:71)
at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:71)
at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:71)
at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:101)
at sbt.compiler.AggressiveCompile$$anonfun$4.compileScala$1(AggressiveCompile.scala:70)
at sbt.compiler.AggressiveCompile$$anonfun$4.apply(AggressiveCompile.scala:88)
at sbt.compiler.AggressiveCompile$$anonfun$4.apply(AggressiveCompile.scala:60)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:24)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:22)
at sbt.inc.Incremental$.cycle(Incremental.scala:52)
at sbt.inc.Incremental$.compile(Incremental.scala:29)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:20)
at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:96)
at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:44)
at com.typesafe.zinc.Compiler.compile(Compiler.scala:158)
at com.typesafe.zinc.Compiler.compile(Compiler.scala:142)
at com.excilys.ebi.gatling.app.ZincCompiler$.apply(ZincCompiler.scala:104)
at com.excilys.ebi.gatling.app.SimulationClassLoader$.fromSourcesDirectory(SimulationClassLoader.scala:34)
at com.excilys.ebi.gatling.app.Gatling$$anonfun$12.apply(Gatling.scala:89)
at com.excilys.ebi.gatling.app.Gatling$$anonfun$12.apply(Gatling.scala:89)
at scala.Option.getOrElse(Option.scala:108)
at com.excilys.ebi.gatling.app.Gatling.start(Gatling.scala:89)
at com.excilys.ebi.gatling.app.Gatling$.fromMap(Gatling.scala:54)
at com.excilys.ebi.gatling.app.Gatling$.runGatling(Gatling.scala:74)
at com.excilys.ebi.gatling.app.Gatling$.main(Gatling.scala:49)
at com.excilys.ebi.gatling.app.Gatling.main(Gatling.scala)

There’s no chance that you generated this Simulation with Gatling 1, “io.gatling” is purely Gatling 2. Don’t mix Gatling 1 and 2 components.

Do you think we should be encouraging new users to use gatling-sbt instead of the compressed download? I could create a skeletal project.

Aidy

Can’t tell: some users are not developers and maybe having to install sbt would shy them away?
Opinions?

You’ll find that an increasing number of users will be testers. Once you’ve created a standard Scala directory structure however, I believe that the basics of sbt are quite easy to use.

Aidy

I’m new to scala and sbt. I’ve been ramping up on scala, but I have put off learning sbt so I don’t get too overwhelmed. Something to reduce the learning curve would be lovely.

Maybe a yeoman generator to create a “new project” that includes both a “run.sh” and a “run.bat” (or something) to allow for command-line execution with parameterization?

Same here. If they didn’t make everything so hidden people wouldn’t be averse to doing these things. Where is the pip install/apt get/brew install/what have you equivalent to getting this done? And where is it documented?