Can I pass Feeder between simulations

Hi All.

I have several groups of users ,that should run several different scenarios with different load rate.

for example:

val group1= scenario(“group1”).exec(Login.login , CreateProject.createproject, Edit.edit , Edit.lookSemples , Login.logout)
val group2= scenario(“group2”).exec(Login.login, CreateProject.createproject, Edit.edit, Edit.Build,Edit.Execute)
.
.
.
val groupN

How can I pass to each user group its own feeder in order to avoid code duplication?

Or do you have some another idea to implement such a scenario?

Thanks in advance.

That’s the beauty of having scenarios as code:

def scn(name: String, feeder: Feeder) = scenario(name)…

val group1 = scn(“group1”, feeder1)
val group2 = scn(“group1”, feeder2)

Hi Stephane .Thanks for quick response.
I built my scenario according to example ,mentioned in : http://gatling.io/docs/2.0.2/advanced_tutorial.html.
So my knowledge in SCALA is not so high .
may you please clarify a little bit more please.

Thanks in advance.

I mean , if my login process looks as fallowing :
how to pass highlighted row as parameter.

thanks in advance.

object Login2Portal {

val feeder = csv(“user_information.csv”).queue
exec { session => println(session) session }
val login = exec(http(“get feeder data”)
.get("/"))
.pause(100 milliseconds)
.feed(feeder)
.exec(http(“RegisterAndLogin2Portal”)
.post("/users")
.headers(headers_0)
.queryParam(“utf8”, “%E2%9C%93”)
.queryParam(“user[name]”, “${username}”)
.queryParam(“user[username]”, “${username}”)
.queryParam(“user[email]”, “${email}”)
.queryParam(“user[password]”, “123456789”)
.queryParam(“user[password_confirmation]”, “123456789”))
.pause(1)
.
.
.
.
}

One of the first things in the quickstart is a pointer to where to learn Scala basics: http://gatling.io/docs/2.0.2/quickstart.html#a-word-on-scala

Hi Stéphane.

Should I Implement Feeder by myself or there is an import of existing one ?
Many Thanks.

Use an existing one if it match you needs. Or just pass the String name.

What import should I involve in order to recognize “Feeder” .
Many Thanks.