Issue with using csv feed. Getting an error value feed is not a member of io.gatling.http.request.builder.Http

Hi,

I am trying to execute the below script and getting an erro that the csv feed is not a member of io.gatling.http.request.builder.Http

The script is given below:

`
package com.oos.loadtesting

import scala.concurrent.duration._

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

class RecordedSimulation extends Simulation {

val httpProtocol = http
.baseURL(“http://172.16.177.111”)
.inferHtmlResources()
.acceptEncodingHeader(“gzip,deflate”)
.contentTypeHeader(""“application/soap+xml;charset=UTF-8;action=“http://service.tib.oos.com/findAddress””"")
.userAgentHeader(“Apache-HttpClient/4.1.1 (java 1.5)”)

val uri1 = “http://172.16.177.111/services/FindAddressPort
val Feeder = csv(“Address-GNAFID.csv”)

val scn = scenario(“RecordedSimulation”)
.exec(http(“request_0”)
.feed(Feeder))
.post("//services/FindAddressPort")
.body(bodyString(s"""<soap:Envelope xmlns:soap=“http://www.w3.org/2003/05/soap-envelope” xmlns:fin=“http://interface.commoti.oos.com/1.0/extn/findAddress” xmlns:com=“http://www.oos.com/yard/odm/1.1/Common” xmlns:tib=“http://data.types.commoti.oos.com/1.1/TibContract” xmlns:cus=“http://www.oos.com/yard/odm/1.1/Custom” xmlns:aus=“http://www.oos.com/AustralianAddress”>soap:Header/soap:Bodyfin:FindAddressRequestcom:interactionID${InteractionID}</com:interactionID>com:interactionDate2016-06-07T21:32:52.12679</com:interactionDate>com:interactionActionGNAFID</com:interactionAction>com:SourceApplicationIDvbn</com:SourceApplicationID>com:serviceNamefindAddress</com:serviceName>com:triggeredBydcad</com:triggeredBy>com:channelCSA</com:channel>com:opIDHOB</com:opID>com:buIDDEFAULT</com:buID>tib:requestModeRR</tib:requestMode>fin:AustralianAddressaus:ID${LocationID}</aus:ID></fin:AustralianAddress></fin:FindAddressRequest></soap:Body></soap:Envelope>""")))

setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)
}
`

Error:

19:16:06.056 [ERROR] i.g.c.ZincCompiler$ - D:\app\gatling-charts-highcharts-bundle-2.2.5\user-files\simulations\com\oos\loadtesting\RecordedSimulation.scala:27: value feed is not a member of io.gatling.http.request.builder.Http possible cause: maybe a semicolon is missing beforevalue feed’?
19:16:06.062 [ERROR] i.g.c.ZincCompiler$ - .feed(csv(“Address-GNAFID.csv”))
19:16:06.068 [ERROR] i.g.c.ZincCompiler$ - ^
`

Can you please help to know what is wrong here?

A feeder cannot be fed to the HTTP request. Move it outside like this

val scn = scenario(“RecordedSimulation”)
.feed(Feeder)
.exec(http(“request_0”)

.post("//services/FindAddressPort")

.

.

)

So how is the examples working then? (unless they are not) https://gatling.io/docs/2.3/advanced_tutorial/

Are you referring to the following example mentioned here → https://gatling.io/docs/2.3/advanced_tutorial/#step-03-use-dynamic-data-with-feeders-and-checks?

The feeder is attached to the exec method, not to the HTTP request.

  val search = exec(http("Home")
    .get("/"))
    .pause(1)
    .feed(feeder) // 3
    .exec(http("Search")
    .get("/computers?f=${searchCriterion}") // 4
    .check(css("a:contains('${searchComputerName}')", "href").saveAs("computerURL"))) // 5
    .pause(1)
    .exec(http("Select")
    .get("${computerURL}")) // 6
    .pause(1)

Ow… that sneaky bracket on the second row… fooled me