Hello,
I am trying to run a test with more than one request.
I am following the site’s directions (http://gatling.io/docs/1.5.6/user_documentation/tutorial/first_steps_with_gatling.html#first-steps-with-gatling) and adding the following to the simulation.scala ’
scn.users(10).protocolConfig(httpConf)'but am getting the following error:
value users is not a member of io.gatling.core.structure.ScenarioBuilder
10:37:36.971 [ERROR] i.g.a.ZincCompiler$ - setUp(scn.users(10).protocols(httpProtocol))
10:37:36.972 [ERROR] i.g.a.ZincCompiler$ - ^
10:37:36.981 [ERROR] i.g.a.ZincCompiler$ - one error found
Compilation failed
I see that the link corresponds to gatling 1.5.6. Is there a new way to change this on 2.0.1?
Thank you for your time.
Hi Daniel,
Maybe you should have a look at Gatling 2.0.1 documentation on that matter : http://gatling.io/docs/2.0.1/general/simulation_setup.html#injection .
Cheers,
Pierre
Thank you Pierre. I followed the link and copied and pasted the following below to the end of my simulation.scala file and am getting the following error:
Error:
not found: value httpConf
10:50:17.587 [ERROR] i.g.a.ZincCompiler$ - ).protocols(httpConf)
10:50:17.587 [ERROR] i.g.a.ZincCompiler$ - ^
10:50:17.608 [ERROR] i.g.a.ZincCompiler$ - one error found
Compilation failed
Copied Text:
setUp(
scn.inject(
nothingFor(4 seconds), // 1
atOnceUsers(10), // 2
rampUsers(10) over(5 seconds), // 3
constantUsersPerSec(20) during(15 seconds), // 4
constantUsersPerSec(20) during(15 seconds) randomized, // 5
rampUsersPerSec(10) to(20) during(10 minutes), // 6
rampUsersPerSec(10) to(20) during(10 minutes) randomized, // 7
splitUsers(1000) into(rampUsers(10) over(10 seconds)) separatedBy(10 seconds), // 8
splitUsers(1000) into(rampUsers(10) over(10 seconds)) separatedBy(atOnceUsers(30)), // 9
heavisideUsers(1000) over(20 seconds) // 10
).protocols(httpConf)
)
What am I doing wrong?
It’s because the val in which you defined your protocol is called httpProtocol in your simulation, and httpConf in the doc. Replace httpConf by httpProtocol and it will work.
But instead of simply copy/pasting the code examples, please read the documentation. You really dont need an injection profile that complicated.
It’s only meant to showcase all the possibilites the injection DSL offers.
Thank you Pierre! I understand.