# Creating Feeder as object

**URL:** <https://community.gatling.io/t/creating-feeder-as-object/1790>\
**Category:** Gatling (Open-Source)\
**Created:** [December 8, 2014, 6:09pm UTC](https://community.gatling.io/t/creating-feeder-as-object/1790 "2014-12-08T18:09:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sameer\_Mainkar](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@Sameer\_Mainkar](https://community.gatling.io/u/Sameer_Mainkar)\
**Post date:** [December 8, 2014, 6:09pm UTC](https://community.gatling.io/t/creating-feeder-as-object/1790/1 "2014-12-08T18:09:04Z")

</div>

Hello,

In my attempt to modularize the scenarios, trying to define custom feeder as an object and then call it another object file, which is not working.

and calling that as

package AllTests  
import scala.concurrent.duration.\_

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

import java.util.concurrent.ThreadLocalRandom  
import customFeeder.\_

object Listings {

val listings = exec(http(“Listings”)  
.get("/listing")  
.check(status.is(400)))

.exec(http(“Listings1”)  
.get("/listing")  
.queryParam(“endTime”,_=\>randomEndTime(55000000))  
.queryParam(“startTime”,_=\>randomStartTime(50000))

Getting compilation error. Would appreciate on how to get this done.

\customFeeder.scala:15: missing arguments for method random  
tartTime in object customFeeder;  
follow this method with `\_’ if you want to treat it as a partially applied func  
ion  
23:27:07.606 [ERROR] i.g.a.ZincCompiler$ - Map(“randomStartTime” → rando  
StartTime,

[customeFeeder.scala](https://community.gatling.io/uploads/short-url/sfKDvjyBO7t1XR6Vp6nAMgdHm5j.scala) (620 Bytes)

---

<div class="post-metadata">

**Author:** ![Sameer\_Mainkar](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@Sameer\_Mainkar](https://community.gatling.io/u/Sameer_Mainkar)\
**Post date:** [December 9, 2014, 7:04am UTC](https://community.gatling.io/t/creating-feeder-as-object/1790/2 "2014-12-09T07:04:45Z")

</div>

Modified the customeFeeder and tried to call that in the object in another scala file, but still getting an error. Attaching modified feeder object file and also snippet of object calling this feeder.

package OvpAPIs  
import scala.concurrent.duration.\_

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

import java.util.concurrent.ThreadLocalRandom  
import timestampFeeder.\_

object Listings {  
feed(timestampFeeder)  
val listings = exec(http(“Listings”)  
.get(“/listing”)  
.check(status.is(400)))

.exec(http(“Listings1”)  
.get(“/listing”)  
.queryParam(“endTime”,randomEndTime)  
.queryParam(“startTime”,randomStartTime)

Getting Following Errors:

not found: value randomEndTime  
.queryParam(“endTime”,randomEndTime)  
type mismatch;  
found : OvpAPIs.timestampFeeder.type  
required: io.gatling.core.feeder.FeederBuilder[\_]

12:25:41.896 [ERROR] i.g.a.ZincCompiler$ - feed(timestampFeeder)

12:25:41.896 [ERROR] i.g.a.ZincCompiler$ - ^

not found: value randomStartTime  
.queryParam(“startTime”,randomStartTime)

not found: valuerandomEndTime  
12:25:42.037 [ERROR] i.g.a.ZincCompiler$ - .queryParam(“endTime”,randomEndTime)  
12:25:42.037 [ERROR] i.g.a.ZincCompiler$ - ^  
12:25:42.224 [ERROR] i.g.a.ZincCompiler$ - four errors found  
Compilation failed

Any help is appreciated.

सोमवार, 8 दिसम्बर 2014 11:39:04 pm UTC+5:30 को, Sameer Mainkar ने लिखा:

> Hello,
> 
> In my attempt to modularize the scenarios, trying to define custom feeder as an object and then call it another object file, which is not working.
> 
> and calling that as
> 
> package AllTests  
> import scala.concurrent.duration.\_
> 
> import io.gatling.core.Predef.\_  
> import io.gatling.http.Predef.\_  
> import io.gatling.jdbc.Predef.\_
> 
> import java.util.concurrent.ThreadLocalRandom  
> import customFeeder.\_
> 
> object Listings {
> 
> val listings = exec(http(“Listings”)  
> .get(“/listing”)  
> .check([status.is](http://status.is)(400)))
> 
> .exec(http(“Listings1”)  
> .get(“/listing”)  
> .queryParam(“endTime”,_=\>randomEndTime(55000000))  
> .queryParam(“startTime”,_=\>randomStartTime(50000))
> 
> Getting compilation error. Would appreciate on how to get this done.
> 
> \customFeeder.scala:15: missing arguments for method random  
> tartTime in object customFeeder;  
> follow this method with `\_’ if you want to treat it as a partially applied func  
> ion  
> 23:27:07.606 [ERROR] i.g.a.ZincCompiler$ - Map(“randomStartTime” → rando  
> StartTime,

सोमवार, 8 दिसम्बर 2014 11:39:04 pm UTC+5:30 को, Sameer Mainkar ने लिखा:

> Hello,
> 
> In my attempt to modularize the scenarios, trying to define custom feeder as an object and then call it another object file, which is not working.
> 
> and calling that as
> 
> package AllTests  
> import scala.concurrent.duration.\_
> 
> import io.gatling.core.Predef.\_  
> import io.gatling.http.Predef.\_  
> import io.gatling.jdbc.Predef.\_
> 
> import java.util.concurrent.ThreadLocalRandom  
> import customFeeder.\_
> 
> object Listings {
> 
> val listings = exec(http(“Listings”)  
> .get(“/listing”)  
> .check([status.is](http://status.is)(400)))
> 
> .exec(http(“Listings1”)  
> .get(“/listing”)  
> .queryParam(“endTime”,_=\>randomEndTime(55000000))  
> .queryParam(“startTime”,_=\>randomStartTime(50000))
> 
> Getting compilation error. Would appreciate on how to get this done.
> 
> \customFeeder.scala:15: missing arguments for method random  
> tartTime in object customFeeder;  
> follow this method with `\_’ if you want to treat it as a partially applied func  
> ion  
> 23:27:07.606 [ERROR] i.g.a.ZincCompiler$ - Map(“randomStartTime” → rando  
> StartTime,

सोमवार, 8 दिसम्बर 2014 11:39:04 pm UTC+5:30 को, Sameer Mainkar ने लिखा:

[timestampFeeder.scala](https://community.gatling.io/uploads/short-url/eG8tjxhsoAKJoyyP4b7wDAqOpXA.scala) (559 Bytes)
