Hi all,
I have created a simulation in gatling.
In that simulation I have imported some packages. But somehow it is giving me following errors:
GATLING_HOME is set to “C:\gatling-charts-highcharts-2.0.0-SNAPSHOT”
12:06:14.912 [ERROR] i.g.a.ZincCompiler$ - C:\gatling-charts-highcharts-2.0.0-SN
APSHOT\user-files\simulations\del\DelphiUISimulation.scala:4: object ProfiledSce
narioBuilder is not a member of package io.gatling.core.structure
12:06:14.915 [ERROR] i.g.a.ZincCompiler$ - import io.gatling.core.structure.Prof
iledScenarioBuilder
12:06:14.915 [ERROR] i.g.a.ZincCompiler$ - ^
12:06:15.431 [ERROR] i.g.a.ZincCompiler$ - C:\gatling-charts-highcharts-2.0.0-SN
APSHOT\user-files\simulations\del\DelphiUISimulation.scala:8: value bootstrap is
not a member of object io.gatling.core.Predef
12:06:15.431 [ERROR] i.g.a.ZincCompiler$ - import io.gatling.core.Predef.bootstr
ap._
12:06:15.431 [ERROR] i.g.a.ZincCompiler$ - ^
12:06:15.432 [ERROR] i.g.a.ZincCompiler$ - C:\gatling-charts-highcharts-2.0.0-SN
APSHOT\user-files\simulations\del\DelphiUISimulation.scala:9: object Headers is
not a member of package io.gatling.http
12:06:15.432 [ERROR] i.g.a.ZincCompiler$ - import io.gatling.http.Headers.Names.
What’s for sure is that you’re trying to use 2M3 syntax with a recent snapshot.
Remove:
import bootstrap._
import assertions._
import Headers._
Thanks.
It worked for me.
I Removed:
import bootstrap._
import assertions._
import Headers._
But I am not getting in what way I shall add following:
Headers.Names => HeaderNames
Headers.Values => HeaderValues
I meant change Headers.Names into HeaderNames
Thanks.
It worked for me.
Actually I have re-factored my code.
I separated headers in headers.scala
Requests in loginSimulation.scala
& base url–upto–userAgentHeader in baseClass.scala
So later executing simulation I am facing following issue
for loginSimulation.scala
Exception in thread “main” java.lang.IllegalAccessException: Class io.gatling.co
re.runner.Runner can not access a member of class del.loginSimulation$ with modi
fiers “private”
at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at io.gatling.core.runner.Runner.run(Runner.scala:36)
at io.gatling.app.Gatling.start(Gatling.scala:231)
at io.gatling.app.Gatling$.fromMap(Gatling.scala:52)
at io.gatling.app.Gatling$.runGatling(Gatling.scala:77)
at io.gatling.app.Gatling$.runGatling(Gatling.scala:56)
at io.gatling.app.Gatling$.main(Gatling.scala:48)
at io.gatling.app.Gatling.main(Gatling.scala)
for baseClass.scala
[ERROR] [04/30/2014 17:54:20.690] [GatlingSystem-akka.actor.default-dispatcher-4
] [akka://GatlingSystem/user/$a] requirement failed: No scenario set up
java.lang.IllegalArgumentException: requirement failed: No scenario set up
at scala.Predef$.require(Predef.scala:233)
at io.gatling.core.scenario.Simulation.scenarios(Simulation.scala:39)
at io.gatling.core.controller.Controller$$anonfun$1.applyOrElse(Controll
er.scala:82)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
at akka.actor.ActorCell.invoke(ActorCell.scala:456)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(Abst
ractDispatcher.scala:385)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool
.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:19
79)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThre
ad.java:107)
17:54:20.776 [ERROR] i.g.c.c.Controller - Actor Controller crashed on message So
me(Run(del.baseClass@4c14029e,baseclass,Timings(None,None,Map())))
java.lang.IllegalArgumentException: requirement failed: No scenario set up
at scala.Predef$.require(Predef.scala:233) ~[scala-library-2.10.4.jar:na
]
at io.gatling.core.scenario.Simulation.scenarios(Simulation.scala:39) ~[
gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.controller.Controller$$anonfun$1.applyOrElse(Controll
er.scala:82) ~[gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498) ~[akka-actor
2.10-2.2.4.jar:2.2.4]
at akka.actor.ActorCell.invoke(ActorCell.scala:456) ~[akka-actor_2.10-2.
2.4.jar:2.2.4]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237) ~[akka-actor
2.10-2.2.4.jar:2.2.4]
at akka.dispatch.Mailbox.run(Mailbox.scala:219) ~[akka-actor_2.10-2.2.4.
jar:2.2.4]
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(Abst
ractDispatcher.scala:385) [akka-actor_2.10-2.2.4.jar:2.2.4]
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
[scala-library-2.10.4.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool
.java:1339) [scala-library-2.10.4.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:19
79) [scala-library-2.10.4.jar:na]
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThre
ad.java:107) [scala-library-2.10.4.jar:na]
Could you please paste your simulation into a gist: https://gist.github.com/
Don’t paste it in a mail.
Here it is baseClass.scala · GitHub
This simulation worked for me in a single file.
loginSimulation must be a class, not an object.
Thanks a ton.
Finally a script is working now.
Can you tell me why simulation gives error for login scenarios?
-
while fetching data from csv file:
HttpRequestAction - No attribute named ‘email’ is defined
Request ‘request_29’ failed: status.in(200,304,201,202,203,204,205,206,207,208,209), but actually found 400
since email & password are column names in csv file.
-
or for some scenarios it gives token error for login
while fetching data from csv file:
HttpRequestAction - No attribute named 'email' is defined
Request 'request_29' failed: status.in(200,304,201,202,203,204,205,206,207,208,209),
but actually found 400
*since email & password are column names in csv file.*
Crystal ball says: trailing spaces in header names.
2.
or for some scenarios it gives token error for login
Applicative