# Can I pass Feeder between simulations

**URL:** <https://community.gatling.io/t/can-i-pass-feeder-between-simulations/1660>\
**Category:** Gatling (Open-Source)\
**Created:** [November 9, 2014, 10:42am UTC](https://community.gatling.io/t/can-i-pass-feeder-between-simulations/1660 "2014-11-09T10:42:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregory\_Melekh](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Gregory\_Melekh](https://community.gatling.io/u/Gregory_Melekh)\
**Post date:** [November 9, 2014, 10:42am UTC](https://community.gatling.io/t/can-i-pass-feeder-between-simulations/1660/1 "2014-11-09T10:42:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 9, 2014, 12:41pm UTC](https://community.gatling.io/t/can-i-pass-feeder-between-simulations/1660/2 "2014-11-09T12:41:28Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Gregory\_Melekh](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Gregory\_Melekh](https://community.gatling.io/u/Gregory_Melekh)\
**Post date:** [November 9, 2014, 1:30pm UTC](https://community.gatling.io/t/can-i-pass-feeder-between-simulations/1660/3 "2014-11-09T13:30:45Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![Gregory\_Melekh](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Gregory\_Melekh](https://community.gatling.io/u/Gregory_Melekh)\
**Post date:** [November 9, 2014, 7:03pm UTC](https://community.gatling.io/t/can-i-pass-feeder-between-simulations/1660/4 "2014-11-09T19:03:20Z")

</div>

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)  
.  
.  
.  
.  
}

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 9, 2014, 9:42pm UTC](https://community.gatling.io/t/can-i-pass-feeder-between-simulations/1660/5 "2014-11-09T21:42:36Z")

</div>

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](http://gatling.io/docs/2.0.2/quickstart.html#a-word-on-scala)

---

<div class="post-metadata">

**Author:** ![Gregory\_Melekh](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Gregory\_Melekh](https://community.gatling.io/u/Gregory_Melekh)\
**Post date:** [November 10, 2014, 9:27am UTC](https://community.gatling.io/t/can-i-pass-feeder-between-simulations/1660/6 "2014-11-10T09:27:54Z")

</div>

Hi Stéphane.

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

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 10, 2014, 9:37am UTC](https://community.gatling.io/t/can-i-pass-feeder-between-simulations/1660/7 "2014-11-10T09:37:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gregory\_Melekh](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Gregory\_Melekh](https://community.gatling.io/u/Gregory_Melekh)\
**Post date:** [November 10, 2014, 9:56am UTC](https://community.gatling.io/t/can-i-pass-feeder-between-simulations/1660/8 "2014-11-10T09:56:47Z")

</div>

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