Creating Feeder as object

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 (620 Bytes)

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(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(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 (559 Bytes)